diff --git a/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md b/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md index b4ec85050526..28a81f908108 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md +++ b/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md @@ -1,14 +1,560 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-09-02) + +- Azure Resource Manager Workloads client library for Java. This package contains Microsoft Azure SDK for Workloads Management SDK. Workloads client provides access to various workload operations. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +#### `models.VirtualMachineResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceInitiatedSoftwareConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `softwareInstallationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ProviderSpecificProperties` was modified + +* `providerType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatabaseServerFullResourceNames` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DeployerVmPackages` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiscoveryConfiguration` was modified + +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshPublicKey` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationsDisplayDefinition` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SoftwareConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `softwareInstallationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ProviderInstancePropertiesErrors` was modified + +* `innerError()` was added +* `code()` was added +* `message()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `details()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `target()` was added + +#### `models.UserAssignedServiceIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiskVolumeConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SshKeyPair` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OSConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `osType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapVirtualInstanceError` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Error` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DeploymentWithOSConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `configurationType()` was added + +#### `models.UpdateSapCentralInstanceRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapVirtualInstanceList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SingleServerCustomResourceNames` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `namingPatternType()` was added + +#### `models.StopRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MessageServerProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapCentralInstanceList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateSapDatabaseInstanceRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SingleServerRecommendationResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `deploymentType()` was added + +#### `models.SapDatabaseInstanceList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapDiskConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SkipFileShareConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OsSapConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnqueueServerProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LoadBalancerDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ThreeTierConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `deploymentType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EnqueueReplicationServerProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapLandscapeMonitorPropertiesGrouping` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ExternalInstallationSoftwareConfiguration` was modified + +* `softwareInstallationType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapNetWeaverProviderInstanceProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `providerType()` was added + +#### `models.SapLandscapeMonitorSidMapping` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HighAvailabilitySoftwareConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HighAvailabilityConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CentralServerVmDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ApplicationServerFullResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiskDetails` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.CentralServerFullResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapAvailabilityZoneDetailsRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LinuxConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `osType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MonitorPropertiesErrors` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `details()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `code()` was added +* `message()` was added +* `target()` was added +* `innerError()` was added + +#### `models.DeploymentConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `configurationType()` was added + +#### `models.ProviderInstanceListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UpdateMonitorRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NetworkConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DB2ProviderInstanceProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `providerType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapDiskConfigurationsRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapApplicationServerInstanceList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SingleServerConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `deploymentType()` was added + +#### `models.ImageReference` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UpdateSapVirtualInstanceRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrometheusHaClusterProviderInstanceProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `providerType()` was added + +#### `models.CreateAndMountFileShareConfiguration` was modified + +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.GatewayServerProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OSProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MsSqlServerProviderInstanceProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `providerType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapSupportedSku` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NetworkInterfaceResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ErrorInnerError` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SshConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapSizingRecommendationRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DatabaseVmDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.WindowsConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `osType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ThreeTierCustomResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `namingPatternType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateSapApplicationInstanceRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MonitorListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ApplicationServerConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DiskSku` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SharedStorageResourceNames` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.LoadBalancerResourceNames` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ErrorDefinition` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrometheusOSProviderInstanceProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `providerType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StorageConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.CentralServerConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapLandscapeMonitorMetricThresholds` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationsDefinitionDisplay` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ThreeTierRecommendationResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `deploymentType()` was added + +#### `models.HanaDbProviderInstanceProperties` was modified + +* `providerType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ThreeTierFullResourceNames` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `namingPatternType()` was added + +#### `models.InfrastructureConfiguration` was modified + +* `deploymentType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DiskConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapConfiguration` was modified + +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedRGConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MountFileShareConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualMachineConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FileShareConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `configurationType()` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SapAvailabilityZonePair` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ApplicationServerVmDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SingleServerFullResourceNames` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `namingPatternType()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapSizingRecommendationResult` was modified + +* `deploymentType()` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SapSupportedSkusRequest` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DatabaseConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added -### Bugs Fixed +#### `models.SapInstallWithoutOSConfigSoftwareConfiguration` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `softwareInstallationType()` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.0.0 (2023-04-17) diff --git a/sdk/workloads/azure-resourcemanager-workloads/README.md b/sdk/workloads/azure-resourcemanager-workloads/README.md index c96ecbfa71d9..7dcee3e276b2 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/README.md +++ b/sdk/workloads/azure-resourcemanager-workloads/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Workloads client library for Java. -This package contains Microsoft Azure SDK for Workloads Management SDK. Workloads client provides access to various workload operations.
Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - Legal Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) for legal notices applicable to Azure Center for SAP solutions. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Workloads Management SDK. Workloads client provides access to various workload operations. Package tag package-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-workloads - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -94,12 +90,15 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fworkloads%2Fazure-resourcemanager-workloads%2FREADME.png) diff --git a/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md b/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md index 2f2d5e0ef122..4ae5d45bc26e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md +++ b/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md @@ -84,23 +84,26 @@ import com.azure.resourcemanager.workloads.models.RoutingPreference; import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Create. */ +/** + * Samples for Monitors Create. + */ public final class MonitorsCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Create.json */ /** * Sample code: Create a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .monitors() + manager.monitors() .define("mySapMonitor") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf("key", "value")) + .withTags(mapOf("key", "fakeTokenPlaceholder")) .withAppLocation("westus") .withRoutingPreference(RoutingPreference.ROUTE_ALL) .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) @@ -111,6 +114,7 @@ public final class MonitorsCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -127,14 +131,18 @@ public final class MonitorsCreateSamples { ### Monitors_Delete ```java -/** Samples for Monitors Delete. */ +/** + * Samples for Monitors Delete. + */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Delete.json */ /** * Sample code: Deletes a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -146,19 +154,22 @@ public final class MonitorsDeleteSamples { ### Monitors_GetByResourceGroup ```java -/** Samples for Monitors GetByResourceGroup. */ +/** + * Samples for Monitors GetByResourceGroup. + */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Get.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .monitors() + manager.monitors() .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } @@ -167,14 +178,18 @@ public final class MonitorsGetByResourceGroupSamples { ### Monitors_List ```java -/** Samples for Monitors List. */ +/** + * Samples for Monitors List. + */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_List.json */ /** * Sample code: List all SAP monitors in a subscription. - * + * * @param manager Entry point to WorkloadsManager. */ public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -186,18 +201,22 @@ public final class MonitorsListSamples { ### Monitors_ListByResourceGroup ```java -/** Samples for Monitors ListByResourceGroup. */ +/** + * Samples for Monitors ListByResourceGroup. + */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_ListByRG.json */ /** * Sample code: List all SAP monitors in a resource group. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void listAllSAPMonitorsInAResourceGroup( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + listAllSAPMonitorsInAResourceGroup(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.monitors().listByResourceGroup("example-rg", com.azure.core.util.Context.NONE); } } @@ -212,50 +231,51 @@ import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Update. */ +/** + * Samples for Monitors Update. + */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_PatchTags_Delete.json */ /** * Sample code: Delete Tags field of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deleteTagsFieldOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - Monitor resource = - manager - .monitors() - .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Monitor resource = manager.monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_PatchTags.json */ /** * Sample code: Update Tags field of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void updateTagsFieldOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - Monitor resource = - manager - .monitors() - .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("testkey", "testvalue")) + Monitor resource = manager.monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -272,14 +292,17 @@ public final class MonitorsUpdateSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json */ /** * Sample code: Operations. - * + * * @param manager Entry point to WorkloadsManager. */ public static void operations(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -300,162 +323,159 @@ import com.azure.resourcemanager.workloads.models.SapNetWeaverProviderInstancePr import com.azure.resourcemanager.workloads.models.SslPreference; import java.util.Arrays; -/** Samples for ProviderInstances Create. */ +/** + * Samples for ProviderInstances Create. + */ public final class ProviderInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Create.json */ /** * Sample code: Create a MsSqlServer provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("sid") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withProviderSettings(new MsSqlServerProviderInstanceProperties().withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a Db2 provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createADb2ProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createADb2ProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new DB2ProviderInstanceProperties() - .withHostname("hostname") - .withDbName("dbName") - .withDbPort("dbPort") - .withDbUsername("username") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("SID") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new DB2ProviderInstanceProperties().withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Create.json */ /** * Sample code: Create a SAP monitor Hana provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslHostnameInCertificate("xyz.domain.com") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSapSid("SID")) + .withProviderSettings(new HanaDbProviderInstanceProperties().withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSapSid("SID")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a SAP monitor NetWeaver provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitorNetWeaverProviderWithRootCertificate( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new SapNetWeaverProviderInstanceProperties() - .withSapSid("SID") - .withSapHostname("name") - .withSapInstanceNr("00") - .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) - .withSapUsername("username") - .withSapPassword("fakeTokenPlaceholder") - .withSapPasswordUri("fakeTokenPlaceholder") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new SapNetWeaverProviderInstanceProperties().withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Create_Root_Certificate.json */ /** * Sample code: Create a MsSqlServer provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAMsSqlServerProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAMsSqlServerProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("sid") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new MsSqlServerProviderInstanceProperties().withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Create.json */ /** * Sample code: Create a PrometheusHaCluster provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAPrometheusHaClusterProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAPrometheusHaClusterProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusHaClusterProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusHaClusterProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withHostname("hostname") .withSid("sid") .withClusterName("clusterName") @@ -465,22 +485,22 @@ public final class ProviderInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a PrometheusHaCluster provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAPrometheusHaClusterProviderWithRootCertificate( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusHaClusterProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusHaClusterProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withHostname("hostname") .withSid("sid") .withClusterName("clusterName") @@ -489,70 +509,69 @@ public final class ProviderInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Create.json */ /** * Sample code: Create a Db2 provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createADb2Provider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new DB2ProviderInstanceProperties() - .withHostname("hostname") - .withDbName("dbName") - .withDbPort("dbPort") - .withDbUsername("username") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("SID") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withProviderSettings(new DB2ProviderInstanceProperties().withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a OS provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAOSProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAOSProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusOSProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withSslPreference(SslPreference.ROOT_CERTIFICATE) .withSapSid("SID")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Create.json */ /** * Sample code: Create a OS provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAOSProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusOSProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withSslPreference(SslPreference.SERVER_CERTIFICATE) .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") .withSapSid("SID")) @@ -560,61 +579,59 @@ public final class ProviderInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Create.json */ /** * Sample code: Create a SAP monitor NetWeaver provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorNetWeaverProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createASAPMonitorNetWeaverProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new SapNetWeaverProviderInstanceProperties() - .withSapSid("SID") - .withSapHostname("name") - .withSapInstanceNr("00") - .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) - .withSapUsername("username") - .withSapPassword("fakeTokenPlaceholder") - .withSapPasswordUri("fakeTokenPlaceholder") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslPreference(SslPreference.SERVER_CERTIFICATE)) + .withProviderSettings(new SapNetWeaverProviderInstanceProperties().withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslPreference(SslPreference.SERVER_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a SAP monitor Hana provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorHanaProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createASAPMonitorHanaProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSslHostnameInCertificate("xyz.domain.com") - .withSslPreference(SslPreference.ROOT_CERTIFICATE) - .withSapSid("SID")) + .withProviderSettings(new HanaDbProviderInstanceProperties().withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) .create(); } } @@ -623,19 +640,22 @@ public final class ProviderInstancesCreateSamples { ### ProviderInstances_Delete ```java -/** Samples for ProviderInstances Delete. */ +/** + * Samples for ProviderInstances Delete. + */ public final class ProviderInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Delete.json */ /** * Sample code: Deletes a SAP monitor provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesASAPMonitorProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .delete("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } } @@ -644,93 +664,101 @@ public final class ProviderInstancesDeleteSamples { ### ProviderInstances_Get ```java -/** Samples for ProviderInstances Get. */ +/** + * Samples for ProviderInstances Get. + */ public final class ProviderInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Get.json */ /** * Sample code: Get properties of a SAP monitor Hana provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfASAPMonitorHanaProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Get.json */ /** * Sample code: Get properties of a PrometheusHaCluster provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfAPrometheusHaClusterProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfAPrometheusHaClusterProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Get.json */ /** * Sample code: Get properties of a OS provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfAOSProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Get.json */ /** * Sample code: Get properties of a Db2 provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfADb2Provider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Get.json */ /** * Sample code: Get properties of a MsSqlServer provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfAMsSqlServerProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Get.json */ /** * Sample code: Get properties of a SAP monitor NetWeaver provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfASAPMonitorNetWeaverProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfASAPMonitorNetWeaverProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } } @@ -739,18 +767,22 @@ public final class ProviderInstancesGetSamples { ### ProviderInstances_List ```java -/** Samples for ProviderInstances List. */ +/** + * Samples for ProviderInstances List. + */ public final class ProviderInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_List.json */ /** * Sample code: List all SAP monitors providers in a subscription. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void listAllSAPMonitorsProvidersInASubscription( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + listAllSAPMonitorsProvidersInASubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.providerInstances().list("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } @@ -759,35 +791,51 @@ public final class ProviderInstancesListSamples { ### ResourceProvider_SapAvailabilityZoneDetails ```java -/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapProductType; + +/** + * Samples for ResourceProvider SapAvailabilityZoneDetails. + */ public final class ResourceProviderSapAvailabilityZoneDetailsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPAvailabilityZoneDetails_northeurope.json */ /** * Sample code: SAPAvailabilityZoneDetails_northeurope. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPAvailabilityZoneDetailsNortheurope( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapAvailabilityZoneDetailsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPAvailabilityZoneDetailsNortheurope(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapAvailabilityZoneDetailsWithResponse("centralus", + new SapAvailabilityZoneDetailsRequest().withAppLocation("northeurope") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPAvailabilityZoneDetails_eastus.json */ /** * Sample code: SAPAvailabilityZoneDetails_eastus. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPAvailabilityZoneDetailsEastus(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapAvailabilityZoneDetailsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapAvailabilityZoneDetailsWithResponse("centralus", + new SapAvailabilityZoneDetailsRequest().withAppLocation("eastus") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } } ``` @@ -795,34 +843,58 @@ public final class ResourceProviderSapAvailabilityZoneDetailsSamples { ### ResourceProvider_SapDiskConfigurations ```java -/** Samples for ResourceProvider SapDiskConfigurations. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapProductType; + +/** + * Samples for ResourceProvider SapDiskConfigurations. + */ public final class ResourceProviderSapDiskConfigurationsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDiskConfigurations_NonProd.json */ /** * Sample code: SAPDiskConfigurations_NonProd. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDiskConfigurationsNonProd(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapDiskConfigurationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapDiskConfigurationsWithResponse("centralus", + new SapDiskConfigurationsRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDiskConfigurations_Prod.json */ /** * Sample code: SAPDiskConfigurations_Prod. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDiskConfigurationsProd(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapDiskConfigurationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapDiskConfigurationsWithResponse("centralus", + new SapDiskConfigurationsRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); } } ``` @@ -830,66 +902,118 @@ public final class ResourceProviderSapDiskConfigurationsSamples { ### ResourceProvider_SapSizingRecommendations ```java -/** Samples for ResourceProvider SapSizingRecommendations. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseScaleMethod; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; + +/** + * Samples for ResourceProvider SapSizingRecommendations. + */ public final class ResourceProviderSapSizingRecommendationsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_Distributed.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_Distributed. - * - * @param manager Entry point to WorkloadsManager. - */ - public static void sAPSizingRecommendationsS4HANADistributed( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + * + * @param manager Entry point to WorkloadsManager. + */ + public static void + sAPSizingRecommendationsS4HANADistributed(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(20000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_SingleServer.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_SingleServer. - * - * @param manager Entry point to WorkloadsManager. - */ - public static void sAPSizingRecommendationsS4HANASingleServer( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + * + * @param manager Entry point to WorkloadsManager. + */ + public static void + sAPSizingRecommendationsS4HANASingleServer(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withSaps(60000L) + .withDbMemory(2000L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_HA_AvZone.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvZone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSizingRecommendationsS4HANADistributedHAAvZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_HA_AvSet.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvSet. - * - * @param manager Entry point to WorkloadsManager. - */ - public static void sAPSizingRecommendationsS4HANADistributedHAAvSet( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + * + * @param manager Entry point to WorkloadsManager. + */ + public static void + sAPSizingRecommendationsS4HANADistributedHAAvSet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); } } ``` @@ -897,56 +1021,103 @@ public final class ResourceProviderSapSizingRecommendationsSamples { ### ResourceProvider_SapSupportedSku ```java -/** Samples for ResourceProvider SapSupportedSku. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; + +/** + * Samples for ResourceProvider SapSupportedSku. + */ public final class ResourceProviderSapSupportedSkuSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_SingleServer.json */ /** * Sample code: SAPSupportedSkus_SingleServer. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSupportedSkusSingleServer(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_Distributed.json */ /** * Sample code: SAPSupportedSkus_Distributed. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSupportedSkusDistributed(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_DistributedHA_AvZone.json */ /** * Sample code: SAPSupportedSkus_DistributedHA_AvZone. - * - * @param manager Entry point to WorkloadsManager. - */ - public static void sAPSupportedSkusDistributedHAAvZone( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + * + * @param manager Entry point to WorkloadsManager. + */ + public static void + sAPSupportedSkusDistributedHAAvZone(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_DistributedHA_AvSet.json */ /** * Sample code: SAPSupportedSkus_DistributedHA_AvSet. - * - * @param manager Entry point to WorkloadsManager. - */ - public static void sAPSupportedSkusDistributedHAAvSet( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + * + * @param manager Entry point to WorkloadsManager. + */ + public static void + sAPSupportedSkusDistributedHAAvSet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); } } ``` @@ -957,20 +1128,23 @@ public final class ResourceProviderSapSupportedSkuSamples { import java.util.HashMap; import java.util.Map; -/** Samples for SapApplicationServerInstances Create. */ +/** + * Samples for SapApplicationServerInstances Create. + */ public final class SapApplicationServerInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Create.json */ /** * Sample code: SAPApplicationServerInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesCreate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + public static void + sAPApplicationServerInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() .define("app01") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -979,17 +1153,18 @@ public final class SapApplicationServerInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Application Server Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPApplicationServerInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + manager.sapApplicationServerInstances() .define("app01") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -997,6 +1172,7 @@ public final class SapApplicationServerInstancesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1013,18 +1189,22 @@ public final class SapApplicationServerInstancesCreateSamples { ### SapApplicationServerInstances_Delete ```java -/** Samples for SapApplicationServerInstances Delete. */ +/** + * Samples for SapApplicationServerInstances Delete. + */ public final class SapApplicationServerInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Delete.json */ /** * Sample code: SAPApplicationServerInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesDelete( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPApplicationServerInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } @@ -1033,19 +1213,22 @@ public final class SapApplicationServerInstancesDeleteSamples { ### SapApplicationServerInstances_Get ```java -/** Samples for SapApplicationServerInstances Get. */ +/** + * Samples for SapApplicationServerInstances Get. + */ public final class SapApplicationServerInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Get.json */ /** * Sample code: SAPApplicationServerInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPApplicationServerInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + manager.sapApplicationServerInstances() .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } @@ -1054,14 +1237,18 @@ public final class SapApplicationServerInstancesGetSamples { ### SapApplicationServerInstances_List ```java -/** Samples for SapApplicationServerInstances List. */ +/** + * Samples for SapApplicationServerInstances List. + */ public final class SapApplicationServerInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_List.json */ /** * Sample code: SAPApplicationServerInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPApplicationServerInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -1073,20 +1260,23 @@ public final class SapApplicationServerInstancesListSamples { ### SapApplicationServerInstances_StartInstance ```java -/** Samples for SapApplicationServerInstances StartInstance. */ +/** + * Samples for SapApplicationServerInstances StartInstance. + */ public final class SapApplicationServerInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_StartInstance.json */ /** * Sample code: Start the SAP Application Server Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheSAPApplicationServerInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + public static void + startTheSAPApplicationServerInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() .startInstance("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } @@ -1097,25 +1287,24 @@ public final class SapApplicationServerInstancesStartInstanceSamples { ```java import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapApplicationServerInstances StopInstance. */ +/** + * Samples for SapApplicationServerInstances StopInstance. + */ public final class SapApplicationServerInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_StopInstance.json */ /** * Sample code: Stop the SAP Application Server Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void stopTheSAPApplicationServerInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() - .stopInstance( - "test-rg", - "X00", - "app01", - new StopRequest().withSoftStopTimeoutSeconds(0L), + public static void + stopTheSAPApplicationServerInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() + .stopInstance("test-rg", "X00", "app01", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } @@ -1128,26 +1317,29 @@ import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; import java.util.HashMap; import java.util.Map; -/** Samples for SapApplicationServerInstances Update. */ +/** + * Samples for SapApplicationServerInstances Update. + */ public final class SapApplicationServerInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Update.json */ /** * Sample code: SAPApplicationServerInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesUpdate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapApplicationServerInstance resource = - manager - .sapApplicationServerInstances() - .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) - .getValue(); + public static void + sAPApplicationServerInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + SapApplicationServerInstance resource = manager.sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1167,20 +1359,23 @@ public final class SapApplicationServerInstancesUpdateSamples { import java.util.HashMap; import java.util.Map; -/** Samples for SapCentralInstances Create. */ +/** + * Samples for SapCentralInstances Create. + */ public final class SapCentralInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Central Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPCentralInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .define("centralServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -1189,16 +1384,17 @@ public final class SapCentralInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Create.json */ /** * Sample code: SAPCentralInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .define("centralServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -1206,6 +1402,7 @@ public final class SapCentralInstancesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1222,14 +1419,18 @@ public final class SapCentralInstancesCreateSamples { ### SapCentralInstances_Delete ```java -/** Samples for SapCentralInstances Delete. */ +/** + * Samples for SapCentralInstances Delete. + */ public final class SapCentralInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Delete.json */ /** * Sample code: SAPCentralInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -1241,19 +1442,22 @@ public final class SapCentralInstancesDeleteSamples { ### SapCentralInstances_Get ```java -/** Samples for SapCentralInstances Get. */ +/** + * Samples for SapCentralInstances Get. + */ public final class SapCentralInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Get.json */ /** * Sample code: SAPCentralInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); } } @@ -1262,14 +1466,18 @@ public final class SapCentralInstancesGetSamples { ### SapCentralInstances_List ```java -/** Samples for SapCentralInstances List. */ +/** + * Samples for SapCentralInstances List. + */ public final class SapCentralInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_List.json */ /** * Sample code: SAPCentralInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -1281,20 +1489,23 @@ public final class SapCentralInstancesListSamples { ### SapCentralInstances_StartInstance ```java -/** Samples for SapCentralInstances StartInstance. */ +/** + * Samples for SapCentralInstances StartInstance. + */ public final class SapCentralInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_StartInstance.json */ /** * Sample code: Start the SAP Central Services Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheSAPCentralServicesInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + public static void + startTheSAPCentralServicesInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapCentralInstances() .startInstance("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); } } @@ -1305,24 +1516,23 @@ public final class SapCentralInstancesStartInstanceSamples { ```java import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapCentralInstances StopInstance. */ +/** + * Samples for SapCentralInstances StopInstance. + */ public final class SapCentralInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_StopInstance.json */ /** * Sample code: Stop the SAP Central Services Instance. - * + * * @param manager Entry point to WorkloadsManager. */ public static void stopTheSAPCentralServicesInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() - .stopInstance( - "test-rg", - "X00", - "centralServer", - new StopRequest().withSoftStopTimeoutSeconds(1200L), + manager.sapCentralInstances() + .stopInstance("test-rg", "X00", "centralServer", new StopRequest().withSoftStopTimeoutSeconds(1200L), com.azure.core.util.Context.NONE); } } @@ -1335,25 +1545,28 @@ import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; import java.util.HashMap; import java.util.Map; -/** Samples for SapCentralInstances Update. */ +/** + * Samples for SapCentralInstances Update. + */ public final class SapCentralInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Update.json */ /** * Sample code: SAPCentralInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapCentralServerInstance resource = - manager - .sapCentralInstances() - .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) - .getValue(); + SapCentralServerInstance resource = manager.sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1373,20 +1586,23 @@ public final class SapCentralInstancesUpdateSamples { import java.util.HashMap; import java.util.Map; -/** Samples for SapDatabaseInstances Create. */ +/** + * Samples for SapDatabaseInstances Create. + */ public final class SapDatabaseInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Database Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPDatabaseInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .define("databaseServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -1395,16 +1611,17 @@ public final class SapDatabaseInstancesCreateSamples { } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Create.json */ /** * Sample code: SAPDatabaseInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .define("databaseServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -1412,6 +1629,7 @@ public final class SapDatabaseInstancesCreateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1428,14 +1646,18 @@ public final class SapDatabaseInstancesCreateSamples { ### SapDatabaseInstances_Delete ```java -/** Samples for SapDatabaseInstances Delete. */ +/** + * Samples for SapDatabaseInstances Delete. + */ public final class SapDatabaseInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Delete.json */ /** * Sample code: SAPDatabaseInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -1447,19 +1669,22 @@ public final class SapDatabaseInstancesDeleteSamples { ### SapDatabaseInstances_Get ```java -/** Samples for SapDatabaseInstances Get. */ +/** + * Samples for SapDatabaseInstances Get. + */ public final class SapDatabaseInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Get.json */ /** * Sample code: SAPDatabaseInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); } } @@ -1468,14 +1693,18 @@ public final class SapDatabaseInstancesGetSamples { ### SapDatabaseInstances_List ```java -/** Samples for SapDatabaseInstances List. */ +/** + * Samples for SapDatabaseInstances List. + */ public final class SapDatabaseInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_List.json */ /** * Sample code: SAPDatabaseInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -1487,18 +1716,22 @@ public final class SapDatabaseInstancesListSamples { ### SapDatabaseInstances_StartInstance ```java -/** Samples for SapDatabaseInstances StartInstance. */ +/** + * Samples for SapDatabaseInstances StartInstance. + */ public final class SapDatabaseInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_StartInstance.json */ /** * Sample code: Start the database instance of the SAP system. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheDatabaseInstanceOfTheSAPSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + startTheDatabaseInstanceOfTheSAPSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapDatabaseInstances().startInstance("test-rg", "X00", "db0", com.azure.core.util.Context.NONE); } } @@ -1509,25 +1742,24 @@ public final class SapDatabaseInstancesStartInstanceSamples { ```java import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapDatabaseInstances StopInstance. */ +/** + * Samples for SapDatabaseInstances StopInstance. + */ public final class SapDatabaseInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_StopInstance.json */ /** * Sample code: Stop the database instance of the SAP system. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void stopTheDatabaseInstanceOfTheSAPSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() - .stopInstance( - "test-rg", - "X00", - "db0", - new StopRequest().withSoftStopTimeoutSeconds(0L), + public static void + stopTheDatabaseInstanceOfTheSAPSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapDatabaseInstances() + .stopInstance("test-rg", "X00", "db0", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } @@ -1540,25 +1772,28 @@ import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; import java.util.HashMap; import java.util.Map; -/** Samples for SapDatabaseInstances Update. */ +/** + * Samples for SapDatabaseInstances Update. + */ public final class SapDatabaseInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Update.json */ /** * Sample code: SAPDatabaseInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapDatabaseInstance resource = - manager - .sapDatabaseInstances() - .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "value1")).apply(); + SapDatabaseInstance resource = manager.sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1581,46 +1816,35 @@ import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesG import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; import java.util.Arrays; -/** Samples for SapLandscapeMonitor Create. */ +/** + * Samples for SapLandscapeMonitor Create. + */ public final class SapLandscapeMonitorCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Create.json */ /** * Sample code: Create for SAP Landscape monitor Dashboard. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createForSAPLandscapeMonitorDashboard( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() - .createWithResponse( - "myResourceGroup", - "mySapMonitor", + public static void + createForSAPLandscapeMonitorDashboard(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapLandscapeMonitors() + .createWithResponse("myResourceGroup", "mySapMonitor", new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("Prod") - .withTopSid(Arrays.asList("SID1", "SID2")))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("ERP1") - .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withGrouping(new SapLandscapeMonitorPropertiesGrouping() + .withLandscape(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("Instance Availability") - .withGreen(90.0F) - .withYellow(75.0F) - .withRed(50.0F))), + Arrays.asList(new SapLandscapeMonitorMetricThresholds().withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), com.azure.core.util.Context.NONE); } } @@ -1629,19 +1853,22 @@ public final class SapLandscapeMonitorCreateSamples { ### SapLandscapeMonitor_Delete ```java -/** Samples for SapLandscapeMonitor Delete. */ +/** + * Samples for SapLandscapeMonitor Delete. + */ public final class SapLandscapeMonitorDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Delete.json */ /** * Sample code: Deletes SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesSAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .deleteByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } @@ -1650,19 +1877,22 @@ public final class SapLandscapeMonitorDeleteSamples { ### SapLandscapeMonitor_Get ```java -/** Samples for SapLandscapeMonitor Get. */ +/** + * Samples for SapLandscapeMonitor Get. + */ public final class SapLandscapeMonitorGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Get.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .getWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } @@ -1671,19 +1901,22 @@ public final class SapLandscapeMonitorGetSamples { ### SapLandscapeMonitor_List ```java -/** Samples for SapLandscapeMonitor List. */ +/** + * Samples for SapLandscapeMonitor List. + */ public final class SapLandscapeMonitorListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_List.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .listWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } @@ -1698,45 +1931,34 @@ import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesG import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; import java.util.Arrays; -/** Samples for SapLandscapeMonitor Update. */ +/** + * Samples for SapLandscapeMonitor Update. + */ public final class SapLandscapeMonitorUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Update.json */ /** * Sample code: Update SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void updateSAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() - .updateWithResponse( - "myResourceGroup", - "mySapMonitor", + manager.sapLandscapeMonitors() + .updateWithResponse("myResourceGroup", "mySapMonitor", new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("Prod") - .withTopSid(Arrays.asList("SID1", "SID2")))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("ERP1") - .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withGrouping(new SapLandscapeMonitorPropertiesGrouping() + .withLandscape(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("Instance Availability") - .withGreen(90.0F) - .withYellow(75.0F) - .withRed(50.0F))), + Arrays.asList(new SapLandscapeMonitorMetricThresholds().withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), com.azure.core.util.Context.NONE); } } @@ -1789,2845 +2011,1819 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for SapVirtualInstances Create. */ +/** + * Samples for SapVirtualInstances Create. + */ public final class SapVirtualInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Install_Distributed.json */ /** * Sample code: Install SAP Software on Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void installSAPSoftwareOnDistributedSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + installSAPSoftwareOnDistributedSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("{{resourcegrp}}") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withSoftwareConfiguration( - new SapInstallWithoutOSConfigSoftwareConfiguration() - .withBomUrl( - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") - .withSapBitsStorageAccountId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") - .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer(new DatabaseConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration(new SapInstallWithoutOSConfigSoftwareConfiguration().withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf("created by", "azureuser")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_HA_AvZone.json */ /** * Sample code: Create Infrastructure only for HA System with Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureOnlyForHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_Distributed.json */ /** * Sample code: Create Infrastructure with OS configuration for Distributed System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForDistributedSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_SingleServer.json */ /** * Sample code: Detect SAP Software Installation on a Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnASingleServerSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Set * (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_HA_AvSet.json */ /** * Sample code: Create Infrastructure only for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureOnlyForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(5L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(5L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_HA_AvZone.json */ /** * Sample code: Detect SAP Software Installation on an HA System with Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_SingleServer.json */ /** * Sample code: Create Infrastructure only for Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createInfrastructureOnlyForSingleServerSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + createInfrastructureOnlyForSingleServerSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData("fakeTokenPlaceholder"))))))))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_CreateTransport.json */ /** * Sample code: Create Infrastructure with a new SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithANewSAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration( - new CreateAndMountFileShareConfiguration() - .withResourceGroup("rgName") - .withStorageAccountName("storageName")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration().withTransportFileShareConfiguration( + new CreateAndMountFileShareConfiguration().withResourceGroup("rgName") + .withStorageAccountName("storageName")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Discover.json */ /** * Sample code: Register existing SAP system as Virtual Instance for SAP solutions. - * + * * @param manager Entry point to WorkloadsManager. */ public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutions( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("northeurope") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DiscoveryConfiguration() - .withCentralServerVmId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withConfiguration(new DiscoveryConfiguration().withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration().withDisablePasswordAuthentication( + true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer(new CentralServerFullResourceNames().withVirtualMachines( + Arrays.asList(new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("ascsdisk0")))))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("ascsdisk0")))))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0"))))) - .withAvailabilitySetName("appAvSet")) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvm") - .withHostname("dbhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbnic"))) - .withOsDiskName("dbosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadata0", "hanadata1"), - "hanaLog", - Arrays.asList("hanalog0", "hanalog1", "hanalog2"), - "hanaShared", - Arrays.asList("hanashared0", "hanashared1"), - "usrSap", - Arrays.asList("usrsap0")))))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays + .asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer(new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList(new VirtualMachineResourceNames().withVmName("dbvm") + .withHostname("dbhostName") + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceResourceNames().withNetworkInterfaceName("dbnic"))) + .withOsDiskName("dbosdisk") + .withDataDiskNames(mapOf("hanaData", Arrays.asList("hanadata0", "hanadata1"), + "hanaLog", Arrays.asList("hanalog0", "hanalog1", "hanalog2"), "hanaShared", + Arrays.asList("hanashared0", "hanashared1"), "usrSap", + Arrays.asList("usrsap0")))))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA system with * Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) + new CentralServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames().withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames(Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames(Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0")))))) .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk"), - new VirtualMachineResourceNames() - .withVmName("ersvm") - .withHostname("ershostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ersnic"))) - .withOsDiskName("ersosdisk"))) - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("ascslb") - .withFrontendIpConfigurationNames( - Arrays.asList("ascsip0", "ersip0")) - .withBackendPoolNames(Arrays.asList("ascsBackendPool")) - .withHealthProbeNames( - Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0")))))) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvmpr") - .withHostname("dbprhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbprnic"))) - .withOsDiskName("dbprosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatapr0", "hanadatapr1"), - "hanaLog", - Arrays - .asList( - "hanalogpr0", "hanalogpr1", "hanalogpr2"), - "hanaShared", - Arrays.asList("hanasharedpr0", "hanasharedpr1"), - "usrSap", - Arrays.asList("usrsappr0"))), - new VirtualMachineResourceNames() - .withVmName("dbvmsr") - .withHostname("dbsrhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbsrnic"))) - .withOsDiskName("dbsrosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatasr0", "hanadatasr1"), - "hanaLog", - Arrays - .asList( - "hanalogsr0", "hanalogsr1", "hanalogsr2"), - "hanaShared", - Arrays.asList("hanasharedsr0", "hanasharedsr1"), - "usrSap", - Arrays.asList("usrsapsr0"))))) - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("dblb") - .withFrontendIpConfigurationNames(Arrays.asList("dbip")) - .withBackendPoolNames(Arrays.asList("dbBackendPool")) - .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames(mapOf( + "hanaData", Arrays.asList("hanadatapr0", "hanadatapr1"), "hanaLog", + Arrays.asList("hanalogpr0", "hanalogpr1", "hanalogpr2"), "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames().withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf("hanaData", Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", Arrays.asList("hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", Arrays.asList("usrsapsr0"))))) + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_MountTransport.json */ /** * Sample code: Create Infrastructure with an existing SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithAnExistingSAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration( - new MountFileShareConfiguration() - .withId( - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") - .withPrivateEndpointId( - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration() + .withTransportFileShareConfiguration(new MountFileShareConfiguration().withId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") + .withPrivateEndpointId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA System with * Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) + new CentralServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames().withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withAvailabilitySetName("csAvSet") + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames(Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames(Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk"), - new VirtualMachineResourceNames() - .withVmName("ersvm") - .withHostname("ershostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ersnic"))) - .withOsDiskName("ersosdisk"))) - .withAvailabilitySetName("csAvSet") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("ascslb") - .withFrontendIpConfigurationNames( - Arrays.asList("ascsip0", "ersip0")) - .withBackendPoolNames(Arrays.asList("ascsBackendPool")) - .withHealthProbeNames( - Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0"))))) - .withAvailabilitySetName("appAvSet")) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvmpr") - .withHostname("dbprhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbprnic"))) - .withOsDiskName("dbprosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatapr0", "hanadatapr1"), - "hanaLog", - Arrays - .asList( - "hanalogpr0", "hanalogpr1", "hanalogpr2"), - "hanaShared", - Arrays.asList("hanasharedpr0", "hanasharedpr1"), - "usrSap", - Arrays.asList("usrsappr0"))), - new VirtualMachineResourceNames() - .withVmName("dbvmsr") - .withHostname("dbsrhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbsrnic"))) - .withOsDiskName("dbsrosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatasr0", "hanadatasr1"), - "hanaLog", - Arrays - .asList( - "hanalogsr0", "hanalogsr1", "hanalogsr2"), - "hanaShared", - Arrays.asList("hanasharedsr0", "hanasharedsr1"), - "usrSap", - Arrays.asList("usrsapsr0"))))) - .withAvailabilitySetName("dbAvSet") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("dblb") - .withFrontendIpConfigurationNames(Arrays.asList("dbip")) - .withBackendPoolNames(Arrays.asList("dbBackendPool")) - .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames(mapOf( + "hanaData", Arrays.asList("hanadatapr0", "hanadatapr1"), "hanaLog", + Arrays.asList("hanalogpr0", "hanalogpr1", "hanalogpr2"), "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames().withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf("hanaData", Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", Arrays.asList("hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", Arrays.asList("usrsapsr0"))))) + .withAvailabilitySetName("dbAvSet") + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json */ /** * Sample code: Create Infrastructure with OS configuration for HA System with Availability Set (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_Distributed.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for Distributed System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_Distributed.json */ /** * Sample code: Detect SAP Software Installation on a Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnADistributedSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("{{resourcegrp}}") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer(new DatabaseConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf("created by", "azureuser")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_HA_AvSet.json */ /** * Sample code: Detect SAP Software Installation on an HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Install_SingleServer.json */ /** * Sample code: Install SAP Software on Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void installSAPSoftwareOnSingleServerSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + installSAPSoftwareOnSingleServerSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("test-rg") - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("SUSE") - .withOffer("SLES-SAP") - .withSku("12-sp4-gen2") - .withVersion("2022.02.01")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureappadmin") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withSoftwareConfiguration( - new SapInstallWithoutOSConfigSoftwareConfiguration() - .withBomUrl( - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") - .withSapBitsStorageAccountId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") - .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("test-rg") + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("SUSE") + .withOffer("SLES-SAP") + .withSku("12-sp4-gen2") + .withVersion("2022.02.01")) + .withOsProfile(new OSProfile().withAdminUsername("azureappadmin") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration(new SapInstallWithoutOSConfigSoftwareConfiguration().withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed.json */ /** * Sample code: Create Infrastructure only for Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createInfrastructureOnlyForDistributedSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + createInfrastructureOnlyForDistributedSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(1L)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json */ /** * Sample code: Register existing SAP system as Virtual Instance for SAP solutions with optional customizations. - * + * * @param manager Entry point to WorkloadsManager. */ public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("northeurope") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DiscoveryConfiguration() - .withCentralServerVmId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") - .withManagedRgStorageAccountName("q20saacssgrs")) + .withConfiguration(new DiscoveryConfiguration().withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") + .withManagedRgStorageAccountName("q20saacssgrs")) .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_SkipTransport.json */ /** * Sample code: Create Infrastructure without a SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithoutASAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration() + .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_SingleServer.json */ /** * Sample code: Create Infrastructure with OS configuration for Single Server System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForSingleServerSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Zone * (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json */ /** * Sample code: Create Infrastructure with OS configuration for HA System with Availability Zone (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_SingleServer.json */ /** * Sample code: Create Infrastructure with Disk and OS configurations for Single Server System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withDbDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withDbDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4644,14 +3840,18 @@ public final class SapVirtualInstancesCreateSamples { ### SapVirtualInstances_Delete ```java -/** Samples for SapVirtualInstances Delete. */ +/** + * Samples for SapVirtualInstances Delete. + */ public final class SapVirtualInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Delete.json */ /** * Sample code: SAPVirtualInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -4663,19 +3863,22 @@ public final class SapVirtualInstancesDeleteSamples { ### SapVirtualInstances_GetByResourceGroup ```java -/** Samples for SapVirtualInstances GetByResourceGroup. */ +/** + * Samples for SapVirtualInstances GetByResourceGroup. + */ public final class SapVirtualInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Get.json */ /** * Sample code: SAPVirtualInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); } } @@ -4684,18 +3887,22 @@ public final class SapVirtualInstancesGetByResourceGroupSamples { ### SapVirtualInstances_List ```java -/** Samples for SapVirtualInstances List. */ +/** + * Samples for SapVirtualInstances List. + */ public final class SapVirtualInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_ListBySubscription.json */ /** * Sample code: SAPVirtualInstances_ListBySubscription. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPVirtualInstancesListBySubscription( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPVirtualInstancesListBySubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapVirtualInstances().list(com.azure.core.util.Context.NONE); } } @@ -4704,18 +3911,22 @@ public final class SapVirtualInstancesListSamples { ### SapVirtualInstances_ListByResourceGroup ```java -/** Samples for SapVirtualInstances ListByResourceGroup. */ +/** + * Samples for SapVirtualInstances ListByResourceGroup. + */ public final class SapVirtualInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_ListByResourceGroup.json */ /** * Sample code: SAPVirtualInstances_ListByResourceGroup. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPVirtualInstancesListByResourceGroup( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPVirtualInstancesListByResourceGroup(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapVirtualInstances().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } @@ -4724,14 +3935,18 @@ public final class SapVirtualInstancesListByResourceGroupSamples { ### SapVirtualInstances_Start ```java -/** Samples for SapVirtualInstances Start. */ +/** + * Samples for SapVirtualInstances Start. + */ public final class SapVirtualInstancesStartSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Start.json */ /** * Sample code: SAPVirtualInstances_Start. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesStart(com.azure.resourcemanager.workloads.WorkloadsManager manager) { @@ -4745,19 +3960,22 @@ public final class SapVirtualInstancesStartSamples { ```java import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapVirtualInstances Stop. */ +/** + * Samples for SapVirtualInstances Stop. + */ public final class SapVirtualInstancesStopSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Stop.json */ /** * Sample code: SAPVirtualInstances_Stop. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesStop(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .stop("test-rg", "X00", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } @@ -4772,29 +3990,31 @@ import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for SapVirtualInstances Update. */ +/** + * Samples for SapVirtualInstances Update. + */ public final class SapVirtualInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Update.json */ /** * Sample code: SAPVirtualInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapVirtualInstance resource = - manager - .sapVirtualInstances() - .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key1", "svi1")) + SapVirtualInstance resource = manager.sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/pom.xml b/sdk/workloads/azure-resourcemanager-workloads/pom.xml index 24a90f5c22f2..969d525f3e78 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/pom.xml +++ b/sdk/workloads/azure-resourcemanager-workloads/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Workloads Management - This package contains Microsoft Azure SDK for Workloads Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Workloads client provides access to various workload operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - Legal Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) for legal notices applicable to Azure Center for SAP solutions. Package tag package-2023-04. + This package contains Microsoft Azure SDK for Workloads Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Workloads client provides access to various workload operations. Package tag package-2023-04. https://github.com/Azure/azure-sdk-for-java @@ -45,8 +45,14 @@ UTF-8 0 0 + true + + com.azure + azure-json + 1.2.0 + com.azure azure-core @@ -87,8 +93,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/WorkloadsManager.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/WorkloadsManager.java index 3e5bfadc5be8..1858aff21e3f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/WorkloadsManager.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/WorkloadsManager.java @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -51,10 +51,8 @@ import java.util.stream.Collectors; /** - * Entry point to WorkloadsManager. Workloads client provides access to various workload operations.<br>Azure - * Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Entry point to WorkloadsManager. + * Workloads client provides access to various workload operations. */ public final class WorkloadsManager { private ResourceProviders resourceProviders; @@ -80,18 +78,16 @@ public final class WorkloadsManager { private WorkloadsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new WorkloadsClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new WorkloadsClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of Workloads service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the Workloads service API instance. @@ -104,7 +100,7 @@ public static WorkloadsManager authenticate(TokenCredential credential, AzurePro /** * Creates an instance of Workloads service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the Workloads service API instance. @@ -117,14 +113,16 @@ public static WorkloadsManager authenticate(HttpPipeline httpPipeline, AzureProf /** * Gets a Configurable instance that can be used to create WorkloadsManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new WorkloadsManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -196,8 +194,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -214,8 +212,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -235,15 +233,13 @@ public WorkloadsManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.workloads") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -268,38 +264,28 @@ public WorkloadsManager authenticate(TokenCredential credential, AzureProfile pr policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new WorkloadsManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of ResourceProviders. - * + * * @return Resource collection API of ResourceProviders. */ public ResourceProviders resourceProviders() { @@ -311,7 +297,7 @@ public ResourceProviders resourceProviders() { /** * Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance. - * + * * @return Resource collection API of SapVirtualInstances. */ public SapVirtualInstances sapVirtualInstances() { @@ -323,7 +309,7 @@ public SapVirtualInstances sapVirtualInstances() { /** * Gets the resource collection API of SapCentralInstances. It manages SapCentralServerInstance. - * + * * @return Resource collection API of SapCentralInstances. */ public SapCentralInstances sapCentralInstances() { @@ -335,7 +321,7 @@ public SapCentralInstances sapCentralInstances() { /** * Gets the resource collection API of SapDatabaseInstances. It manages SapDatabaseInstance. - * + * * @return Resource collection API of SapDatabaseInstances. */ public SapDatabaseInstances sapDatabaseInstances() { @@ -347,20 +333,20 @@ public SapDatabaseInstances sapDatabaseInstances() { /** * Gets the resource collection API of SapApplicationServerInstances. It manages SapApplicationServerInstance. - * + * * @return Resource collection API of SapApplicationServerInstances. */ public SapApplicationServerInstances sapApplicationServerInstances() { if (this.sapApplicationServerInstances == null) { - this.sapApplicationServerInstances = - new SapApplicationServerInstancesImpl(clientObject.getSapApplicationServerInstances(), this); + this.sapApplicationServerInstances + = new SapApplicationServerInstancesImpl(clientObject.getSapApplicationServerInstances(), this); } return sapApplicationServerInstances; } /** * Gets the resource collection API of Monitors. It manages Monitor. - * + * * @return Resource collection API of Monitors. */ public Monitors monitors() { @@ -372,7 +358,7 @@ public Monitors monitors() { /** * Gets the resource collection API of ProviderInstances. It manages ProviderInstance. - * + * * @return Resource collection API of ProviderInstances. */ public ProviderInstances providerInstances() { @@ -384,7 +370,7 @@ public ProviderInstances providerInstances() { /** * Gets the resource collection API of SapLandscapeMonitors. - * + * * @return Resource collection API of SapLandscapeMonitors. */ public SapLandscapeMonitors sapLandscapeMonitors() { @@ -396,7 +382,7 @@ public SapLandscapeMonitors sapLandscapeMonitors() { /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -407,8 +393,10 @@ public Operations operations() { } /** - * @return Wrapped service client WorkloadsClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client WorkloadsClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client WorkloadsClient. */ public WorkloadsClient serviceClient() { return this.clientObject; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/MonitorsClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/MonitorsClient.java index 7acd6d1bac49..604784e36b5b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/MonitorsClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/MonitorsClient.java @@ -15,14 +15,16 @@ import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.workloads.models.UpdateMonitorRequest; -/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in MonitorsClient. + */ public interface MonitorsClient { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. @@ -32,10 +34,10 @@ public interface MonitorsClient { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -47,9 +49,9 @@ public interface MonitorsClient { /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,9 +63,9 @@ public interface MonitorsClient { /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,9 +78,9 @@ public interface MonitorsClient { /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -86,17 +88,17 @@ public interface MonitorsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +111,9 @@ Response getByResourceGroupWithResponse( /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -119,17 +121,17 @@ Response getByResourceGroupWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MonitorInner> beginCreate( - String resourceGroupName, String monitorName, MonitorInner monitorParameter); + SyncPoller, MonitorInner> beginCreate(String resourceGroupName, String monitorName, + MonitorInner monitorParameter); /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -138,17 +140,17 @@ SyncPoller, MonitorInner> beginCreate( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MonitorInner> beginCreate( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context); + SyncPoller, MonitorInner> beginCreate(String resourceGroupName, String monitorName, + MonitorInner monitorParameter, Context context); /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -162,9 +164,9 @@ SyncPoller, MonitorInner> beginCreate( /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -179,9 +181,9 @@ SyncPoller, MonitorInner> beginCreate( /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -190,14 +192,14 @@ SyncPoller, MonitorInner> beginCreate( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String monitorName); /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -207,14 +209,14 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String monitorName, Context context); /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -227,9 +229,9 @@ SyncPoller, OperationStatusResultInner> b /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -243,9 +245,9 @@ SyncPoller, OperationStatusResultInner> b /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. @@ -256,14 +258,14 @@ SyncPoller, OperationStatusResultInner> b * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String monitorName, UpdateMonitorRequest body, Context context); + Response updateWithResponse(String resourceGroupName, String monitorName, UpdateMonitorRequest body, + Context context); /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/OperationsClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/OperationsClient.java index d7f248a0848c..48574840e70e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/OperationsClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/OperationsClient.java @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all the available API operations under this PR. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists all the available API operations under this PR. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ProviderInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ProviderInstancesClient.java index b66489a8ed56..9a13a0825b3c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ProviderInstancesClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ProviderInstancesClient.java @@ -14,49 +14,51 @@ import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; -/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in ProviderInstancesClient. + */ public interface ProviderInstancesClient { /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String monitorName); /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String monitorName, Context context); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -65,18 +67,18 @@ public interface ProviderInstancesClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response}. + * resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String monitorName, String providerInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String monitorName, + String providerInstanceName, Context context); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -84,17 +86,16 @@ Response getWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name. + * resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) ProviderInstanceInner get(String resourceGroupName, String monitorName, String providerInstanceName); /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -105,18 +106,14 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProviderInstanceInner> beginCreate( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter); + SyncPoller, ProviderInstanceInner> beginCreate(String resourceGroupName, + String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter); /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -128,19 +125,15 @@ SyncPoller, ProviderInstanceInner> beginCreate * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProviderInstanceInner> beginCreate( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, + SyncPoller, ProviderInstanceInner> beginCreate(String resourceGroupName, + String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter, Context context); /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -151,18 +144,14 @@ SyncPoller, ProviderInstanceInner> beginCreate * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInstanceInner create( - String resourceGroupName, - String monitorName, - String providerInstanceName, + ProviderInstanceInner create(String resourceGroupName, String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter); /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -174,19 +163,14 @@ ProviderInstanceInner create( * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProviderInstanceInner create( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, - Context context); + ProviderInstanceInner create(String resourceGroupName, String monitorName, String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, Context context); /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -196,15 +180,14 @@ ProviderInstanceInner create( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, String providerInstanceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String monitorName, String providerInstanceName); /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -215,15 +198,14 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String monitorName, String providerInstanceName, Context context); /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -237,10 +219,9 @@ SyncPoller, OperationStatusResultInner> b /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -251,6 +232,6 @@ SyncPoller, OperationStatusResultInner> b * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String monitorName, String providerInstanceName, + Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ResourceProvidersClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ResourceProvidersClient.java index 3902497c6dc1..3dabee234d88 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ResourceProvidersClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ResourceProvidersClient.java @@ -17,12 +17,14 @@ import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ public interface ResourceProvidersClient { /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @param sapSizingRecommendation SAP Sizing Recommendation Request body. * @param context The context to associate with this operation. @@ -30,29 +32,29 @@ public interface ResourceProvidersClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier along with {@link Response}. + * tier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sapSizingRecommendationsWithResponse( - String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + Response sapSizingRecommendationsWithResponse(String location, + SapSizingRecommendationRequest sapSizingRecommendation, Context context); /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier. + * tier. */ @ServiceMethod(returns = ReturnType.SINGLE) SapSizingRecommendationResultInner sapSizingRecommendations(String location); /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @param sapSupportedSku SAP Supported SKU Request body. * @param context The context to associate with this operation. @@ -62,12 +64,12 @@ Response sapSizingRecommendationsWithRespons * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sapSupportedSkuWithResponse( - String location, SapSupportedSkusRequest sapSupportedSku, Context context); + Response sapSupportedSkuWithResponse(String location, + SapSupportedSkusRequest sapSupportedSku, Context context); /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -79,7 +81,7 @@ Response sapSupportedSkuWithResponse( /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @param sapDiskConfigurations SAP Disk Configurations Request body. * @param context The context to associate with this operation. @@ -89,12 +91,12 @@ Response sapSupportedSkuWithResponse( * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sapDiskConfigurationsWithResponse( - String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + Response sapDiskConfigurationsWithResponse(String location, + SapDiskConfigurationsRequest sapDiskConfigurations, Context context); /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,7 +108,7 @@ Response sapDiskConfigurationsWithResponse( /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. * @param context The context to associate with this operation. @@ -116,12 +118,12 @@ Response sapDiskConfigurationsWithResponse( * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sapAvailabilityZoneDetailsWithResponse( - String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); + Response sapAvailabilityZoneDetailsWithResponse(String location, + SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapApplicationServerInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapApplicationServerInstancesClient.java index 78a554fa4765..f2401410ca15 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapApplicationServerInstancesClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapApplicationServerInstancesClient.java @@ -16,11 +16,13 @@ import com.azure.resourcemanager.workloads.models.StopRequest; import com.azure.resourcemanager.workloads.models.UpdateSapApplicationInstanceRequest; -/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. + */ public interface SapApplicationServerInstancesClient { /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -29,15 +31,15 @@ public interface SapApplicationServerInstancesClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response}. + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -47,13 +49,13 @@ Response getWithResponse( * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapApplicationServerInstanceInner get( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SapApplicationServerInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -63,13 +65,13 @@ SapApplicationServerInstanceInner get( * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapApplicationServerInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SyncPoller, SapApplicationServerInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -82,16 +84,13 @@ SyncPoller, SapApplicationServerIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SapApplicationServerInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context); + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + SapApplicationServerInstanceInner body, Context context); /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -101,13 +100,13 @@ SyncPoller, SapApplicationServerIn * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapApplicationServerInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SapApplicationServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -119,16 +118,12 @@ SapApplicationServerInstanceInner create( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapApplicationServerInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context); + SapApplicationServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, SapApplicationServerInstanceInner body, Context context); /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -138,12 +133,12 @@ SapApplicationServerInstanceInner create( * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapApplicationServerInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SyncPoller, SapApplicationServerInstanceInner> + beginUpdate(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -156,15 +151,12 @@ SyncPoller, SapApplicationServerIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SapApplicationServerInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context); + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, Context context); /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -174,12 +166,12 @@ SyncPoller, SapApplicationServerIn * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapApplicationServerInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SapApplicationServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -191,17 +183,13 @@ SapApplicationServerInstanceInner update( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapApplicationServerInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context); + SapApplicationServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, UpdateSapApplicationInstanceRequest body, Context context); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -211,13 +199,13 @@ SapApplicationServerInstanceInner update( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -228,13 +216,13 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -244,13 +232,13 @@ SyncPoller, OperationStatusResultInner> b * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -261,42 +249,42 @@ OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context); + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -306,12 +294,12 @@ PagedIterable list( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -327,7 +315,7 @@ SyncPoller, OperationStatusResultInner> b /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -337,12 +325,12 @@ SyncPoller, OperationStatusResultInner> b * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -353,12 +341,12 @@ OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -368,12 +356,12 @@ OperationStatusResultInner startInstance( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -386,15 +374,12 @@ SyncPoller, OperationStatusResultInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body, Context context); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -404,12 +389,12 @@ SyncPoller, OperationStatusResultInner> b * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -421,10 +406,6 @@ OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body, Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapCentralInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapCentralInstancesClient.java index 58e1e5a40657..6dda4620c65b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapCentralInstancesClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapCentralInstancesClient.java @@ -16,15 +16,17 @@ import com.azure.resourcemanager.workloads.models.StopRequest; import com.azure.resourcemanager.workloads.models.UpdateSapCentralInstanceRequest; -/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapCentralInstancesClient. + */ public interface SapCentralInstancesClient { /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -32,50 +34,50 @@ public interface SapCentralInstancesClient { * @return the SAP Central Services Instance resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context); /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapCentralServerInstanceInner get( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SapCentralServerInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapCentralServerInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SyncPoller, SapCentralServerInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -85,37 +87,34 @@ SyncPoller, SapCentralServerInstanceIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SapCentralServerInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context); + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + SapCentralServerInstanceInner body, Context context); /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapCentralServerInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SapCentralServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,38 +123,34 @@ SapCentralServerInstanceInner create( * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapCentralServerInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context); + SapCentralServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, SapCentralServerInstanceInner body, Context context); /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapCentralServerInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SyncPoller, SapCentralServerInstanceInner> + beginUpdate(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -165,37 +160,34 @@ SyncPoller, SapCentralServerInstanceIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SapCentralServerInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context); + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + UpdateSapCentralInstanceRequest body, Context context); /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapCentralServerInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SapCentralServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -204,40 +196,36 @@ SapCentralServerInstanceInner update( * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapCentralServerInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context); + SapCentralServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, UpdateSapCentralInstanceRequest body, Context context); /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName); /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -245,36 +233,36 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, Context context); /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -282,62 +270,62 @@ OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context); /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context); + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -350,27 +338,27 @@ SyncPoller, OperationStatusResultInner> b /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -378,32 +366,32 @@ OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -413,35 +401,32 @@ SyncPoller, OperationStatusResultInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body, Context context); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -450,10 +435,6 @@ OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body, Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapDatabaseInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapDatabaseInstancesClient.java index 91dae265c27d..ce2f06138189 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapDatabaseInstancesClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapDatabaseInstancesClient.java @@ -16,15 +16,17 @@ import com.azure.resourcemanager.workloads.models.StopRequest; import com.azure.resourcemanager.workloads.models.UpdateSapDatabaseInstanceRequest; -/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. + */ public interface SapDatabaseInstancesClient { /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -32,16 +34,16 @@ public interface SapDatabaseInstancesClient { * @return the SAP Database Instance resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context); /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -53,28 +55,28 @@ Response getWithResponse( /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapDatabaseInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SyncPoller, SapDatabaseInstanceInner> beginCreate(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName); /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -83,38 +85,34 @@ SyncPoller, SapDatabaseInstanceInner> begin * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapDatabaseInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context); + SyncPoller, SapDatabaseInstanceInner> beginCreate(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, SapDatabaseInstanceInner body, Context context); /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapDatabaseInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SapDatabaseInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -123,36 +121,32 @@ SapDatabaseInstanceInner create( * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapDatabaseInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context); + SapDatabaseInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, SapDatabaseInstanceInner body, Context context); /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapDatabaseInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SyncPoller, SapDatabaseInstanceInner> beginUpdate(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName); /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -161,36 +155,33 @@ SyncPoller, SapDatabaseInstanceInner> begin * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapDatabaseInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, + SyncPoller, SapDatabaseInstanceInner> beginUpdate(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, UpdateSapDatabaseInstanceRequest body, Context context); /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapDatabaseInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SapDatabaseInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -199,38 +190,34 @@ SapDatabaseInstanceInner update( * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapDatabaseInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, - Context context); + SapDatabaseInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, UpdateSapDatabaseInstanceRequest body, Context context); /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName); /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -238,34 +225,34 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, Context context); /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -273,12 +260,12 @@ OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context); /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -291,7 +278,7 @@ OperationStatusResultInner delete( /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -301,32 +288,32 @@ OperationStatusResultInner delete( * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context); + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -339,27 +326,27 @@ SyncPoller, OperationStatusResultInner> b /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -367,32 +354,32 @@ OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -402,35 +389,32 @@ SyncPoller, OperationStatusResultInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body, Context context); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -439,10 +423,6 @@ OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context); + OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body, Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapLandscapeMonitorsClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapLandscapeMonitorsClient.java index 6eb132516669..84078fa058bf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapLandscapeMonitorsClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapLandscapeMonitorsClient.java @@ -11,14 +11,16 @@ import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorListResultInner; -/** An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. + */ public interface SapLandscapeMonitorsClient { /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -26,37 +28,37 @@ public interface SapLandscapeMonitorsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String monitorName, Context context); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) SapLandscapeMonitorInner get(String resourceGroupName, String monitorName); /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -64,36 +66,32 @@ public interface SapLandscapeMonitorsClient { * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context); + Response createWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context); /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapLandscapeMonitorInner create( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + SapLandscapeMonitorInner create(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter); /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -107,10 +105,9 @@ SapLandscapeMonitorInner create( /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,14 +119,13 @@ SapLandscapeMonitorInner create( /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -137,37 +133,33 @@ SapLandscapeMonitorInner create( * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context); + Response updateWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context); /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapLandscapeMonitorInner update( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + SapLandscapeMonitorInner update(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -175,25 +167,25 @@ SapLandscapeMonitorInner update( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String monitorName, Context context); + Response listWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) SapLandscapeMonitorListResultInner list(String resourceGroupName, String monitorName); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapVirtualInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapVirtualInstancesClient.java index 83af80773357..e56d7b6eb033 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapVirtualInstancesClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapVirtualInstancesClient.java @@ -16,11 +16,13 @@ import com.azure.resourcemanager.workloads.models.StopRequest; import com.azure.resourcemanager.workloads.models.UpdateSapVirtualInstanceRequest; -/** An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. + */ public interface SapVirtualInstancesClient { /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,12 +31,12 @@ public interface SapVirtualInstancesClient { * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapVirtualInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName); + SyncPoller, SapVirtualInstanceInner> beginCreate(String resourceGroupName, + String sapVirtualInstanceName); /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -45,12 +47,12 @@ SyncPoller, SapVirtualInstanceInner> beginCr * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SapVirtualInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + SyncPoller, SapVirtualInstanceInner> beginCreate(String resourceGroupName, + String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,7 +65,7 @@ SyncPoller, SapVirtualInstanceInner> beginCr /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -74,12 +76,12 @@ SyncPoller, SapVirtualInstanceInner> beginCr * @return define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SapVirtualInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + SapVirtualInstanceInner body, Context context); /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -89,12 +91,12 @@ SapVirtualInstanceInner create( * @return a Virtual Instance for SAP solutions resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sapVirtualInstanceName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String sapVirtualInstanceName, Context context); /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,7 +109,7 @@ Response getByResourceGroupWithResponse( /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Request body to update a Virtual Instance for SAP solutions resource. @@ -118,12 +120,12 @@ Response getByResourceGroupWithResponse( * @return define the Virtual Instance for SAP solutions resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body, Context context); + Response updateWithResponse(String resourceGroupName, String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, Context context); /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +139,7 @@ Response updateWithResponse( /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,13 +148,13 @@ Response updateWithResponse( * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName); /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -162,13 +164,13 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginDelete(String resourceGroupName, + String sapVirtualInstanceName, Context context); /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -182,7 +184,7 @@ SyncPoller, OperationStatusResultInner> b /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -196,58 +198,58 @@ SyncPoller, OperationStatusResultInner> b /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -256,12 +258,12 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStart( - String resourceGroupName, String sapVirtualInstanceName); + SyncPoller, OperationStatusResultInner> beginStart(String resourceGroupName, + String sapVirtualInstanceName); /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -271,12 +273,12 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStart( - String resourceGroupName, String sapVirtualInstanceName, Context context); + SyncPoller, OperationStatusResultInner> beginStart(String resourceGroupName, + String sapVirtualInstanceName, Context context); /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -289,7 +291,7 @@ SyncPoller, OperationStatusResultInner> b /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -303,7 +305,7 @@ SyncPoller, OperationStatusResultInner> b /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -312,12 +314,12 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStop( - String resourceGroupName, String sapVirtualInstanceName); + SyncPoller, OperationStatusResultInner> beginStop(String resourceGroupName, + String sapVirtualInstanceName); /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -328,12 +330,12 @@ SyncPoller, OperationStatusResultInner> b * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OperationStatusResultInner> beginStop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + SyncPoller, OperationStatusResultInner> beginStop(String resourceGroupName, + String sapVirtualInstanceName, StopRequest body, Context context); /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -346,7 +348,7 @@ SyncPoller, OperationStatusResultInner> b /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -357,6 +359,6 @@ SyncPoller, OperationStatusResultInner> b * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner stop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + OperationStatusResultInner stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, + Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WorkloadsClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WorkloadsClient.java index 75046ed2db4e..c5b0ba9e82ed 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WorkloadsClient.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WorkloadsClient.java @@ -7,102 +7,104 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for WorkloadsClient class. */ +/** + * The interface for WorkloadsClient class. + */ public interface WorkloadsClient { /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the ResourceProvidersClient object to access its operations. - * + * * @return the ResourceProvidersClient object. */ ResourceProvidersClient getResourceProviders(); /** * Gets the SapVirtualInstancesClient object to access its operations. - * + * * @return the SapVirtualInstancesClient object. */ SapVirtualInstancesClient getSapVirtualInstances(); /** * Gets the SapCentralInstancesClient object to access its operations. - * + * * @return the SapCentralInstancesClient object. */ SapCentralInstancesClient getSapCentralInstances(); /** * Gets the SapDatabaseInstancesClient object to access its operations. - * + * * @return the SapDatabaseInstancesClient object. */ SapDatabaseInstancesClient getSapDatabaseInstances(); /** * Gets the SapApplicationServerInstancesClient object to access its operations. - * + * * @return the SapApplicationServerInstancesClient object. */ SapApplicationServerInstancesClient getSapApplicationServerInstances(); /** * Gets the MonitorsClient object to access its operations. - * + * * @return the MonitorsClient object. */ MonitorsClient getMonitors(); /** * Gets the ProviderInstancesClient object to access its operations. - * + * * @return the ProviderInstancesClient object. */ ProviderInstancesClient getProviderInstances(); /** * Gets the SapLandscapeMonitorsClient object to access its operations. - * + * * @return the SapLandscapeMonitorsClient object. */ SapLandscapeMonitorsClient getSapLandscapeMonitors(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorInner.java index f7c9f915c329..32e2cc8269f4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorInner.java @@ -7,42 +7,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; import com.azure.resourcemanager.workloads.models.MonitorPropertiesErrors; import com.azure.resourcemanager.workloads.models.RoutingPreference; import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; import com.azure.resourcemanager.workloads.models.WorkloadMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** SAP monitor info on Azure (ARM properties and SAP monitor properties). */ +/** + * SAP monitor info on Azure (ARM properties and SAP monitor properties). + */ @Fluent public final class MonitorInner extends Resource { /* * [currently not in use] Managed service identity(user assigned identities) */ - @JsonProperty(value = "identity") private UserAssignedServiceIdentity identity; /* * SAP monitor properties */ - @JsonProperty(value = "properties") private MonitorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of MonitorInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of MonitorInner class. + */ public MonitorInner() { } /** * Get the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @return the identity value. */ public UserAssignedServiceIdentity identity() { @@ -51,7 +70,7 @@ public UserAssignedServiceIdentity identity() { /** * Set the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @param identity the identity value to set. * @return the MonitorInner object itself. */ @@ -62,7 +81,7 @@ public MonitorInner withIdentity(UserAssignedServiceIdentity identity) { /** * Get the innerProperties property: SAP monitor properties. - * + * * @return the innerProperties value. */ private MonitorProperties innerProperties() { @@ -71,21 +90,55 @@ private MonitorProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public MonitorInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MonitorInner withTags(Map tags) { super.withTags(tags); @@ -94,7 +147,7 @@ public MonitorInner withTags(Map tags) { /** * Get the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ public WorkloadMonitorProvisioningState provisioningState() { @@ -103,7 +156,7 @@ public WorkloadMonitorProvisioningState provisioningState() { /** * Get the errors property: Defines the SAP monitor errors. - * + * * @return the errors value. */ public MonitorPropertiesErrors errors() { @@ -113,7 +166,7 @@ public MonitorPropertiesErrors errors() { /** * Get the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet * region should be same as the SAP monitoring region. - * + * * @return the appLocation value. */ public String appLocation() { @@ -123,7 +176,7 @@ public String appLocation() { /** * Set the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet * region should be same as the SAP monitoring region. - * + * * @param appLocation the appLocation value to set. * @return the MonitorInner object itself. */ @@ -138,7 +191,7 @@ public MonitorInner withAppLocation(String appLocation) { /** * Get the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. - * + * * @return the routingPreference value. */ public RoutingPreference routingPreference() { @@ -148,7 +201,7 @@ public RoutingPreference routingPreference() { /** * Set the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. - * + * * @param routingPreference the routingPreference value to set. * @return the MonitorInner object itself. */ @@ -163,7 +216,7 @@ public MonitorInner withRoutingPreference(RoutingPreference routingPreference) { /** * Get the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the * SAP monitor. By default resources will be created which do not support zone redundancy. - * + * * @return the zoneRedundancyPreference value. */ public String zoneRedundancyPreference() { @@ -173,7 +226,7 @@ public String zoneRedundancyPreference() { /** * Set the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the * SAP monitor. By default resources will be created which do not support zone redundancy. - * + * * @param zoneRedundancyPreference the zoneRedundancyPreference value to set. * @return the MonitorInner object itself. */ @@ -187,7 +240,7 @@ public MonitorInner withZoneRedundancyPreference(String zoneRedundancyPreference /** * Get the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ public ManagedRGConfiguration managedResourceGroupConfiguration() { @@ -196,12 +249,12 @@ public ManagedRGConfiguration managedResourceGroupConfiguration() { /** * Set the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the MonitorInner object itself. */ - public MonitorInner withManagedResourceGroupConfiguration( - ManagedRGConfiguration managedResourceGroupConfiguration) { + public MonitorInner + withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { if (this.innerProperties() == null) { this.innerProperties = new MonitorProperties(); } @@ -212,7 +265,7 @@ public MonitorInner withManagedResourceGroupConfiguration( /** * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. - * + * * @return the logAnalyticsWorkspaceArmId value. */ public String logAnalyticsWorkspaceArmId() { @@ -222,7 +275,7 @@ public String logAnalyticsWorkspaceArmId() { /** * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. - * + * * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. * @return the MonitorInner object itself. */ @@ -236,7 +289,7 @@ public MonitorInner withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceA /** * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @return the monitorSubnet value. */ public String monitorSubnet() { @@ -245,7 +298,7 @@ public String monitorSubnet() { /** * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @param monitorSubnet the monitorSubnet value to set. * @return the MonitorInner object itself. */ @@ -259,7 +312,7 @@ public MonitorInner withMonitorSubnet(String monitorSubnet) { /** * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. - * + * * @return the msiArmId value. */ public String msiArmId() { @@ -268,7 +321,7 @@ public String msiArmId() { /** * Get the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. - * + * * @return the storageAccountArmId value. */ public String storageAccountArmId() { @@ -277,7 +330,7 @@ public String storageAccountArmId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -288,4 +341,59 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MonitorInner. + */ + public static MonitorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorInner deserializedMonitorInner = new MonitorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMonitorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMonitorInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMonitorInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMonitorInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedMonitorInner.identity = UserAssignedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedMonitorInner.innerProperties = MonitorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMonitorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorProperties.java index 4f1250fe0083..64abc2cd5002 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/MonitorProperties.java @@ -5,84 +5,82 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; import com.azure.resourcemanager.workloads.models.MonitorPropertiesErrors; import com.azure.resourcemanager.workloads.models.RoutingPreference; import com.azure.resourcemanager.workloads.models.WorkloadMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Describes the properties of a SAP monitor. */ +/** + * Describes the properties of a SAP monitor. + */ @Fluent -public final class MonitorProperties { +public final class MonitorProperties implements JsonSerializable { /* * State of provisioning of the SAP monitor. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private WorkloadMonitorProvisioningState provisioningState; /* * Defines the SAP monitor errors. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private MonitorPropertiesErrors errors; /* * The SAP monitor resources will be deployed in the SAP monitoring region. The subnet region should be same as the * SAP monitoring region. */ - @JsonProperty(value = "appLocation") private String appLocation; /* * Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. */ - @JsonProperty(value = "routingPreference") private RoutingPreference routingPreference; /* * Sets the preference for zone redundancy on resources created for the SAP monitor. By default resources will be * created which do not support zone redundancy. */ - @JsonProperty(value = "zoneRedundancyPreference") private String zoneRedundancyPreference; /* * Managed resource group configuration */ - @JsonProperty(value = "managedResourceGroupConfiguration") private ManagedRGConfiguration managedResourceGroupConfiguration; /* * The ARM ID of the Log Analytics Workspace that is used for SAP monitoring. */ - @JsonProperty(value = "logAnalyticsWorkspaceArmId") private String logAnalyticsWorkspaceArmId; /* * The subnet which the SAP monitor will be deployed in */ - @JsonProperty(value = "monitorSubnet") private String monitorSubnet; /* * The ARM ID of the MSI used for SAP monitoring. */ - @JsonProperty(value = "msiArmId", access = JsonProperty.Access.WRITE_ONLY) private String msiArmId; /* * The ARM ID of the Storage account used for SAP monitoring. */ - @JsonProperty(value = "storageAccountArmId", access = JsonProperty.Access.WRITE_ONLY) private String storageAccountArmId; - /** Creates an instance of MonitorProperties class. */ + /** + * Creates an instance of MonitorProperties class. + */ public MonitorProperties() { } /** * Get the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ public WorkloadMonitorProvisioningState provisioningState() { @@ -91,7 +89,7 @@ public WorkloadMonitorProvisioningState provisioningState() { /** * Get the errors property: Defines the SAP monitor errors. - * + * * @return the errors value. */ public MonitorPropertiesErrors errors() { @@ -101,7 +99,7 @@ public MonitorPropertiesErrors errors() { /** * Get the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet * region should be same as the SAP monitoring region. - * + * * @return the appLocation value. */ public String appLocation() { @@ -111,7 +109,7 @@ public String appLocation() { /** * Set the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet * region should be same as the SAP monitoring region. - * + * * @param appLocation the appLocation value to set. * @return the MonitorProperties object itself. */ @@ -123,7 +121,7 @@ public MonitorProperties withAppLocation(String appLocation) { /** * Get the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. - * + * * @return the routingPreference value. */ public RoutingPreference routingPreference() { @@ -133,7 +131,7 @@ public RoutingPreference routingPreference() { /** * Set the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. - * + * * @param routingPreference the routingPreference value to set. * @return the MonitorProperties object itself. */ @@ -145,7 +143,7 @@ public MonitorProperties withRoutingPreference(RoutingPreference routingPreferen /** * Get the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the * SAP monitor. By default resources will be created which do not support zone redundancy. - * + * * @return the zoneRedundancyPreference value. */ public String zoneRedundancyPreference() { @@ -155,7 +153,7 @@ public String zoneRedundancyPreference() { /** * Set the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the * SAP monitor. By default resources will be created which do not support zone redundancy. - * + * * @param zoneRedundancyPreference the zoneRedundancyPreference value to set. * @return the MonitorProperties object itself. */ @@ -166,7 +164,7 @@ public MonitorProperties withZoneRedundancyPreference(String zoneRedundancyPrefe /** * Get the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ public ManagedRGConfiguration managedResourceGroupConfiguration() { @@ -175,12 +173,12 @@ public ManagedRGConfiguration managedResourceGroupConfiguration() { /** * Set the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the MonitorProperties object itself. */ - public MonitorProperties withManagedResourceGroupConfiguration( - ManagedRGConfiguration managedResourceGroupConfiguration) { + public MonitorProperties + withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; return this; } @@ -188,7 +186,7 @@ public MonitorProperties withManagedResourceGroupConfiguration( /** * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. - * + * * @return the logAnalyticsWorkspaceArmId value. */ public String logAnalyticsWorkspaceArmId() { @@ -198,7 +196,7 @@ public String logAnalyticsWorkspaceArmId() { /** * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. - * + * * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. * @return the MonitorProperties object itself. */ @@ -209,7 +207,7 @@ public MonitorProperties withLogAnalyticsWorkspaceArmId(String logAnalyticsWorks /** * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @return the monitorSubnet value. */ public String monitorSubnet() { @@ -218,7 +216,7 @@ public String monitorSubnet() { /** * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @param monitorSubnet the monitorSubnet value to set. * @return the MonitorProperties object itself. */ @@ -229,7 +227,7 @@ public MonitorProperties withMonitorSubnet(String monitorSubnet) { /** * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. - * + * * @return the msiArmId value. */ public String msiArmId() { @@ -238,7 +236,7 @@ public String msiArmId() { /** * Get the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. - * + * * @return the storageAccountArmId value. */ public String storageAccountArmId() { @@ -247,7 +245,7 @@ public String storageAccountArmId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -258,4 +256,66 @@ public void validate() { managedResourceGroupConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeStringField("routingPreference", + this.routingPreference == null ? null : this.routingPreference.toString()); + jsonWriter.writeStringField("zoneRedundancyPreference", this.zoneRedundancyPreference); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + jsonWriter.writeStringField("logAnalyticsWorkspaceArmId", this.logAnalyticsWorkspaceArmId); + jsonWriter.writeStringField("monitorSubnet", this.monitorSubnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorProperties. + */ + public static MonitorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorProperties deserializedMonitorProperties = new MonitorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedMonitorProperties.provisioningState + = WorkloadMonitorProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedMonitorProperties.errors = MonitorPropertiesErrors.fromJson(reader); + } else if ("appLocation".equals(fieldName)) { + deserializedMonitorProperties.appLocation = reader.getString(); + } else if ("routingPreference".equals(fieldName)) { + deserializedMonitorProperties.routingPreference = RoutingPreference.fromString(reader.getString()); + } else if ("zoneRedundancyPreference".equals(fieldName)) { + deserializedMonitorProperties.zoneRedundancyPreference = reader.getString(); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedMonitorProperties.managedResourceGroupConfiguration + = ManagedRGConfiguration.fromJson(reader); + } else if ("logAnalyticsWorkspaceArmId".equals(fieldName)) { + deserializedMonitorProperties.logAnalyticsWorkspaceArmId = reader.getString(); + } else if ("monitorSubnet".equals(fieldName)) { + deserializedMonitorProperties.monitorSubnet = reader.getString(); + } else if ("msiArmId".equals(fieldName)) { + deserializedMonitorProperties.msiArmId = reader.getString(); + } else if ("storageAccountArmId".equals(fieldName)) { + deserializedMonitorProperties.storageAccountArmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationInner.java index 7fab65435ada..875372897bc0 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationInner.java @@ -5,59 +5,60 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ActionType; import com.azure.resourcemanager.workloads.models.OperationDisplay; import com.azure.resourcemanager.workloads.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for * ARM/control-plane operations. */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default * value is "user,system" */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -67,7 +68,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -76,7 +77,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -85,7 +86,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -97,7 +98,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -107,7 +108,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -116,7 +117,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -124,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationStatusResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationStatusResultInner.java index 54f58574ee5f..e37d058f39e1 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationStatusResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/OperationStatusResultInner.java @@ -6,69 +6,71 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** The current status of an async operation. */ +/** + * The current status of an async operation. + */ @Fluent -public final class OperationStatusResultInner { +public final class OperationStatusResultInner implements JsonSerializable { /* * Fully qualified ID for the async operation. */ - @JsonProperty(value = "id") private String id; /* * Name of the async operation. */ - @JsonProperty(value = "name") private String name; /* * Operation status. */ - @JsonProperty(value = "status", required = true) private String status; /* * Percent of the operation that is complete. */ - @JsonProperty(value = "percentComplete") private Float percentComplete; /* * The start time of the operation. */ - @JsonProperty(value = "startTime") private OffsetDateTime startTime; /* * The end time of the operation. */ - @JsonProperty(value = "endTime") private OffsetDateTime endTime; /* * The operations list. */ - @JsonProperty(value = "operations") private List operations; /* * If present, details of the operation error. */ - @JsonProperty(value = "error") private ManagementError error; - /** Creates an instance of OperationStatusResultInner class. */ + /** + * Creates an instance of OperationStatusResultInner class. + */ public OperationStatusResultInner() { } /** * Get the id property: Fully qualified ID for the async operation. - * + * * @return the id value. */ public String id() { @@ -77,7 +79,7 @@ public String id() { /** * Set the id property: Fully qualified ID for the async operation. - * + * * @param id the id value to set. * @return the OperationStatusResultInner object itself. */ @@ -88,7 +90,7 @@ public OperationStatusResultInner withId(String id) { /** * Get the name property: Name of the async operation. - * + * * @return the name value. */ public String name() { @@ -97,7 +99,7 @@ public String name() { /** * Set the name property: Name of the async operation. - * + * * @param name the name value to set. * @return the OperationStatusResultInner object itself. */ @@ -108,7 +110,7 @@ public OperationStatusResultInner withName(String name) { /** * Get the status property: Operation status. - * + * * @return the status value. */ public String status() { @@ -117,7 +119,7 @@ public String status() { /** * Set the status property: Operation status. - * + * * @param status the status value to set. * @return the OperationStatusResultInner object itself. */ @@ -128,7 +130,7 @@ public OperationStatusResultInner withStatus(String status) { /** * Get the percentComplete property: Percent of the operation that is complete. - * + * * @return the percentComplete value. */ public Float percentComplete() { @@ -137,7 +139,7 @@ public Float percentComplete() { /** * Set the percentComplete property: Percent of the operation that is complete. - * + * * @param percentComplete the percentComplete value to set. * @return the OperationStatusResultInner object itself. */ @@ -148,7 +150,7 @@ public OperationStatusResultInner withPercentComplete(Float percentComplete) { /** * Get the startTime property: The start time of the operation. - * + * * @return the startTime value. */ public OffsetDateTime startTime() { @@ -157,7 +159,7 @@ public OffsetDateTime startTime() { /** * Set the startTime property: The start time of the operation. - * + * * @param startTime the startTime value to set. * @return the OperationStatusResultInner object itself. */ @@ -168,7 +170,7 @@ public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { /** * Get the endTime property: The end time of the operation. - * + * * @return the endTime value. */ public OffsetDateTime endTime() { @@ -177,7 +179,7 @@ public OffsetDateTime endTime() { /** * Set the endTime property: The end time of the operation. - * + * * @param endTime the endTime value to set. * @return the OperationStatusResultInner object itself. */ @@ -188,7 +190,7 @@ public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { /** * Get the operations property: The operations list. - * + * * @return the operations value. */ public List operations() { @@ -197,7 +199,7 @@ public List operations() { /** * Set the operations property: The operations list. - * + * * @param operations the operations value to set. * @return the OperationStatusResultInner object itself. */ @@ -208,7 +210,7 @@ public OperationStatusResultInner withOperations(List e.validate()); @@ -244,4 +245,68 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getFloat); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceInner.java index 452bb6bf31c5..b6615ffadc5d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceInner.java @@ -7,40 +7,59 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ProviderInstancePropertiesErrors; import com.azure.resourcemanager.workloads.models.ProviderSpecificProperties; import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; import com.azure.resourcemanager.workloads.models.WorkloadMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** A provider instance associated with SAP monitor. */ +/** + * A provider instance associated with SAP monitor. + */ @Fluent public final class ProviderInstanceInner extends ProxyResource { /* * [currently not in use] Managed service identity(user assigned identities) */ - @JsonProperty(value = "identity") private UserAssignedServiceIdentity identity; /* * Provider Instance properties */ - @JsonProperty(value = "properties") private ProviderInstanceProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ProviderInstanceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ProviderInstanceInner class. + */ public ProviderInstanceInner() { } /** * Get the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @return the identity value. */ public UserAssignedServiceIdentity identity() { @@ -49,7 +68,7 @@ public UserAssignedServiceIdentity identity() { /** * Set the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @param identity the identity value to set. * @return the ProviderInstanceInner object itself. */ @@ -60,7 +79,7 @@ public ProviderInstanceInner withIdentity(UserAssignedServiceIdentity identity) /** * Get the innerProperties property: Provider Instance properties. - * + * * @return the innerProperties value. */ private ProviderInstanceProperties innerProperties() { @@ -69,16 +88,46 @@ private ProviderInstanceProperties innerProperties() { /** * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the provisioningState property: State of provisioning of the provider instance. - * + * * @return the provisioningState value. */ public WorkloadMonitorProvisioningState provisioningState() { @@ -87,7 +136,7 @@ public WorkloadMonitorProvisioningState provisioningState() { /** * Get the errors property: Defines the provider instance errors. - * + * * @return the errors value. */ public ProviderInstancePropertiesErrors errors() { @@ -96,7 +145,7 @@ public ProviderInstancePropertiesErrors errors() { /** * Get the providerSettings property: Defines the provider specific properties. - * + * * @return the providerSettings value. */ public ProviderSpecificProperties providerSettings() { @@ -105,7 +154,7 @@ public ProviderSpecificProperties providerSettings() { /** * Set the providerSettings property: Defines the provider specific properties. - * + * * @param providerSettings the providerSettings value to set. * @return the ProviderInstanceInner object itself. */ @@ -119,7 +168,7 @@ public ProviderInstanceInner withProviderSettings(ProviderSpecificProperties pro /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -130,4 +179,52 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProviderInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProviderInstanceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProviderInstanceInner. + */ + public static ProviderInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProviderInstanceInner deserializedProviderInstanceInner = new ProviderInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProviderInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProviderInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProviderInstanceInner.type = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedProviderInstanceInner.identity = UserAssignedServiceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedProviderInstanceInner.innerProperties = ProviderInstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProviderInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProviderInstanceInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceProperties.java index 57922356382d..4c167f3ad7b4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/ProviderInstanceProperties.java @@ -5,39 +5,44 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ProviderInstancePropertiesErrors; import com.azure.resourcemanager.workloads.models.ProviderSpecificProperties; import com.azure.resourcemanager.workloads.models.WorkloadMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Describes the properties of a provider instance. */ +/** + * Describes the properties of a provider instance. + */ @Fluent -public final class ProviderInstanceProperties { +public final class ProviderInstanceProperties implements JsonSerializable { /* * State of provisioning of the provider instance */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private WorkloadMonitorProvisioningState provisioningState; /* * Defines the provider instance errors. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private ProviderInstancePropertiesErrors errors; /* * Defines the provider specific properties. */ - @JsonProperty(value = "providerSettings") private ProviderSpecificProperties providerSettings; - /** Creates an instance of ProviderInstanceProperties class. */ + /** + * Creates an instance of ProviderInstanceProperties class. + */ public ProviderInstanceProperties() { } /** * Get the provisioningState property: State of provisioning of the provider instance. - * + * * @return the provisioningState value. */ public WorkloadMonitorProvisioningState provisioningState() { @@ -46,7 +51,7 @@ public WorkloadMonitorProvisioningState provisioningState() { /** * Get the errors property: Defines the provider instance errors. - * + * * @return the errors value. */ public ProviderInstancePropertiesErrors errors() { @@ -55,7 +60,7 @@ public ProviderInstancePropertiesErrors errors() { /** * Get the providerSettings property: Defines the provider specific properties. - * + * * @return the providerSettings value. */ public ProviderSpecificProperties providerSettings() { @@ -64,7 +69,7 @@ public ProviderSpecificProperties providerSettings() { /** * Set the providerSettings property: Defines the provider specific properties. - * + * * @param providerSettings the providerSettings value to set. * @return the ProviderInstanceProperties object itself. */ @@ -75,7 +80,7 @@ public ProviderInstanceProperties withProviderSettings(ProviderSpecificPropertie /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -86,4 +91,46 @@ public void validate() { providerSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("providerSettings", this.providerSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProviderInstanceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProviderInstanceProperties. + */ + public static ProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProviderInstanceProperties deserializedProviderInstanceProperties = new ProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedProviderInstanceProperties.provisioningState + = WorkloadMonitorProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedProviderInstanceProperties.errors = ProviderInstancePropertiesErrors.fromJson(reader); + } else if ("providerSettings".equals(fieldName)) { + deserializedProviderInstanceProperties.providerSettings + = ProviderSpecificProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerInstanceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerInstanceInner.java index 5d1e4d089cd5..ce279fbd610d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerInstanceInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerInstanceInner.java @@ -7,38 +7,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ApplicationServerVmDetails; import com.azure.resourcemanager.workloads.models.LoadBalancerDetails; import com.azure.resourcemanager.workloads.models.SapHealthState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Define the SAP Application Server Instance resource. */ +/** + * Define the SAP Application Server Instance resource. + */ @Fluent public final class SapApplicationServerInstanceInner extends Resource { /* * Defines the SAP Application Server instance properties. */ - @JsonProperty(value = "properties") private SapApplicationServerProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of SapApplicationServerInstanceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SapApplicationServerInstanceInner class. + */ public SapApplicationServerInstanceInner() { } /** * Get the innerProperties property: Defines the SAP Application Server instance properties. - * + * * @return the innerProperties value. */ private SapApplicationServerProperties innerProperties() { @@ -47,21 +67,55 @@ private SapApplicationServerProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public SapApplicationServerInstanceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SapApplicationServerInstanceInner withTags(Map tags) { super.withTags(tags); @@ -70,7 +124,7 @@ public SapApplicationServerInstanceInner withTags(Map tags) { /** * Get the instanceNo property: Application server Instance Number. - * + * * @return the instanceNo value. */ public String instanceNo() { @@ -79,7 +133,7 @@ public String instanceNo() { /** * Get the subnet property: Application server Subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -88,7 +142,7 @@ public String subnet() { /** * Get the hostname property: Application server instance SAP hostname. - * + * * @return the hostname value. */ public String hostname() { @@ -97,7 +151,7 @@ public String hostname() { /** * Get the kernelVersion property: Application server instance SAP Kernel Version. - * + * * @return the kernelVersion value. */ public String kernelVersion() { @@ -106,7 +160,7 @@ public String kernelVersion() { /** * Get the kernelPatch property: Application server instance SAP Kernel Patch level. - * + * * @return the kernelPatch value. */ public String kernelPatch() { @@ -115,7 +169,7 @@ public String kernelPatch() { /** * Get the ipAddress property: Application server instance SAP IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -124,7 +178,7 @@ public String ipAddress() { /** * Get the gatewayPort property: Application server instance gateway Port. - * + * * @return the gatewayPort value. */ public Long gatewayPort() { @@ -133,7 +187,7 @@ public Long gatewayPort() { /** * Get the icmHttpPort property: Application server instance ICM HTTP Port. - * + * * @return the icmHttpPort value. */ public Long icmHttpPort() { @@ -142,7 +196,7 @@ public Long icmHttpPort() { /** * Get the icmHttpsPort property: Application server instance ICM HTTPS Port. - * + * * @return the icmHttpsPort value. */ public Long icmHttpsPort() { @@ -152,7 +206,7 @@ public Long icmHttpsPort() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application * Server Virtual Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -161,7 +215,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -170,7 +224,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -179,7 +233,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -188,7 +242,7 @@ public SapHealthState health() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -197,7 +251,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the Application Instance errors. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -206,7 +260,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -214,4 +268,58 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapApplicationServerInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapApplicationServerInstanceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapApplicationServerInstanceInner. + */ + public static SapApplicationServerInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapApplicationServerInstanceInner deserializedSapApplicationServerInstanceInner + = new SapApplicationServerInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSapApplicationServerInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.innerProperties + = SapApplicationServerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSapApplicationServerInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapApplicationServerInstanceInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerProperties.java index a96f08ebfbec..596ce3afbad5 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerProperties.java @@ -5,115 +5,108 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ApplicationServerVmDetails; import com.azure.resourcemanager.workloads.models.LoadBalancerDetails; import com.azure.resourcemanager.workloads.models.SapHealthState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the SAP Application Server instance properties. */ +/** + * Defines the SAP Application Server instance properties. + */ @Immutable -public final class SapApplicationServerProperties { +public final class SapApplicationServerProperties implements JsonSerializable { /* * Application server Instance Number. */ - @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) private String instanceNo; /* * Application server Subnet. */ - @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) private String subnet; /* * Application server instance SAP hostname. */ - @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * Application server instance SAP Kernel Version. */ - @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) private String kernelVersion; /* * Application server instance SAP Kernel Patch level. */ - @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) private String kernelPatch; /* * Application server instance SAP IP Address. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * Application server instance gateway Port. */ - @JsonProperty(value = "gatewayPort", access = JsonProperty.Access.WRITE_ONLY) private Long gatewayPort; /* * Application server instance ICM HTTP Port. */ - @JsonProperty(value = "icmHttpPort", access = JsonProperty.Access.WRITE_ONLY) private Long icmHttpPort; /* * Application server instance ICM HTTPS Port. */ - @JsonProperty(value = "icmHttpsPort", access = JsonProperty.Access.WRITE_ONLY) private Long icmHttpsPort; /* * The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines */ - @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) private LoadBalancerDetails loadBalancerDetails; /* * The list of virtual machines. */ - @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) private List vmDetails; /* * Defines the SAP Instance status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceStatus status; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; /* * Defines the provisioning states. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceProvisioningState provisioningState; /* * Defines the Application Instance errors. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceError errors; - /** Creates an instance of SapApplicationServerProperties class. */ + /** + * Creates an instance of SapApplicationServerProperties class. + */ public SapApplicationServerProperties() { } /** * Get the instanceNo property: Application server Instance Number. - * + * * @return the instanceNo value. */ public String instanceNo() { @@ -122,7 +115,7 @@ public String instanceNo() { /** * Get the subnet property: Application server Subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -131,7 +124,7 @@ public String subnet() { /** * Get the hostname property: Application server instance SAP hostname. - * + * * @return the hostname value. */ public String hostname() { @@ -140,7 +133,7 @@ public String hostname() { /** * Get the kernelVersion property: Application server instance SAP Kernel Version. - * + * * @return the kernelVersion value. */ public String kernelVersion() { @@ -149,7 +142,7 @@ public String kernelVersion() { /** * Get the kernelPatch property: Application server instance SAP Kernel Patch level. - * + * * @return the kernelPatch value. */ public String kernelPatch() { @@ -158,7 +151,7 @@ public String kernelPatch() { /** * Get the ipAddress property: Application server instance SAP IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -167,7 +160,7 @@ public String ipAddress() { /** * Get the gatewayPort property: Application server instance gateway Port. - * + * * @return the gatewayPort value. */ public Long gatewayPort() { @@ -176,7 +169,7 @@ public Long gatewayPort() { /** * Get the icmHttpPort property: Application server instance ICM HTTP Port. - * + * * @return the icmHttpPort value. */ public Long icmHttpPort() { @@ -185,7 +178,7 @@ public Long icmHttpPort() { /** * Get the icmHttpsPort property: Application server instance ICM HTTPS Port. - * + * * @return the icmHttpsPort value. */ public Long icmHttpsPort() { @@ -195,7 +188,7 @@ public Long icmHttpsPort() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application * Server Virtual Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -204,7 +197,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -213,7 +206,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -222,7 +215,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -231,7 +224,7 @@ public SapHealthState health() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -240,7 +233,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the Application Instance errors. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -249,7 +242,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -263,4 +256,73 @@ public void validate() { errors().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapApplicationServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapApplicationServerProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapApplicationServerProperties. + */ + public static SapApplicationServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapApplicationServerProperties deserializedSapApplicationServerProperties + = new SapApplicationServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceNo".equals(fieldName)) { + deserializedSapApplicationServerProperties.instanceNo = reader.getString(); + } else if ("subnet".equals(fieldName)) { + deserializedSapApplicationServerProperties.subnet = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedSapApplicationServerProperties.hostname = reader.getString(); + } else if ("kernelVersion".equals(fieldName)) { + deserializedSapApplicationServerProperties.kernelVersion = reader.getString(); + } else if ("kernelPatch".equals(fieldName)) { + deserializedSapApplicationServerProperties.kernelPatch = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedSapApplicationServerProperties.ipAddress = reader.getString(); + } else if ("gatewayPort".equals(fieldName)) { + deserializedSapApplicationServerProperties.gatewayPort = reader.getNullable(JsonReader::getLong); + } else if ("icmHttpPort".equals(fieldName)) { + deserializedSapApplicationServerProperties.icmHttpPort = reader.getNullable(JsonReader::getLong); + } else if ("icmHttpsPort".equals(fieldName)) { + deserializedSapApplicationServerProperties.icmHttpsPort = reader.getNullable(JsonReader::getLong); + } else if ("loadBalancerDetails".equals(fieldName)) { + deserializedSapApplicationServerProperties.loadBalancerDetails + = LoadBalancerDetails.fromJson(reader); + } else if ("vmDetails".equals(fieldName)) { + List vmDetails + = reader.readArray(reader1 -> ApplicationServerVmDetails.fromJson(reader1)); + deserializedSapApplicationServerProperties.vmDetails = vmDetails; + } else if ("status".equals(fieldName)) { + deserializedSapApplicationServerProperties.status + = SapVirtualInstanceStatus.fromString(reader.getString()); + } else if ("health".equals(fieldName)) { + deserializedSapApplicationServerProperties.health = SapHealthState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSapApplicationServerProperties.provisioningState + = SapVirtualInstanceProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedSapApplicationServerProperties.errors = SapVirtualInstanceError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapApplicationServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapAvailabilityZoneDetailsResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapAvailabilityZoneDetailsResultInner.java index d9f76ccef12c..11ca540c7145 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapAvailabilityZoneDetailsResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapAvailabilityZoneDetailsResultInner.java @@ -5,26 +5,34 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.SapAvailabilityZonePair; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The list of supported availability zone pairs which are part of SAP HA deployment. */ +/** + * The list of supported availability zone pairs which are part of SAP HA deployment. + */ @Fluent -public final class SapAvailabilityZoneDetailsResultInner { +public final class SapAvailabilityZoneDetailsResultInner + implements JsonSerializable { /* * Gets the list of availability zone pairs. */ - @JsonProperty(value = "availabilityZonePairs") private List availabilityZonePairs; - /** Creates an instance of SapAvailabilityZoneDetailsResultInner class. */ + /** + * Creates an instance of SapAvailabilityZoneDetailsResultInner class. + */ public SapAvailabilityZoneDetailsResultInner() { } /** * Get the availabilityZonePairs property: Gets the list of availability zone pairs. - * + * * @return the availabilityZonePairs value. */ public List availabilityZonePairs() { @@ -33,19 +41,19 @@ public List availabilityZonePairs() { /** * Set the availabilityZonePairs property: Gets the list of availability zone pairs. - * + * * @param availabilityZonePairs the availabilityZonePairs value to set. * @return the SapAvailabilityZoneDetailsResultInner object itself. */ - public SapAvailabilityZoneDetailsResultInner withAvailabilityZonePairs( - List availabilityZonePairs) { + public SapAvailabilityZoneDetailsResultInner + withAvailabilityZonePairs(List availabilityZonePairs) { this.availabilityZonePairs = availabilityZonePairs; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -53,4 +61,44 @@ public void validate() { availabilityZonePairs().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("availabilityZonePairs", this.availabilityZonePairs, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapAvailabilityZoneDetailsResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapAvailabilityZoneDetailsResultInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapAvailabilityZoneDetailsResultInner. + */ + public static SapAvailabilityZoneDetailsResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapAvailabilityZoneDetailsResultInner deserializedSapAvailabilityZoneDetailsResultInner + = new SapAvailabilityZoneDetailsResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZonePairs".equals(fieldName)) { + List availabilityZonePairs + = reader.readArray(reader1 -> SapAvailabilityZonePair.fromJson(reader1)); + deserializedSapAvailabilityZoneDetailsResultInner.availabilityZonePairs = availabilityZonePairs; + } else { + reader.skipChildren(); + } + } + + return deserializedSapAvailabilityZoneDetailsResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerInstanceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerInstanceInner.java index 73e7d5d91b28..2974b0955f7b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerInstanceInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerInstanceInner.java @@ -7,6 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; import com.azure.resourcemanager.workloads.models.EnqueueReplicationServerProperties; import com.azure.resourcemanager.workloads.models.EnqueueServerProperties; @@ -17,32 +20,49 @@ import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Define the SAP Central Services Instance resource. */ +/** + * Define the SAP Central Services Instance resource. + */ @Fluent public final class SapCentralServerInstanceInner extends Resource { /* * Defines the SAP Central Services Instance properties. */ - @JsonProperty(value = "properties") private SapCentralServerProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of SapCentralServerInstanceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SapCentralServerInstanceInner class. + */ public SapCentralServerInstanceInner() { } /** * Get the innerProperties property: Defines the SAP Central Services Instance properties. - * + * * @return the innerProperties value. */ private SapCentralServerProperties innerProperties() { @@ -51,21 +71,55 @@ private SapCentralServerProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public SapCentralServerInstanceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SapCentralServerInstanceInner withTags(Map tags) { super.withTags(tags); @@ -74,7 +128,7 @@ public SapCentralServerInstanceInner withTags(Map tags) { /** * Get the instanceNo property: The central services instance number. - * + * * @return the instanceNo value. */ public String instanceNo() { @@ -83,7 +137,7 @@ public String instanceNo() { /** * Get the subnet property: The central services instance subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -92,7 +146,7 @@ public String subnet() { /** * Get the messageServerProperties property: Defines the SAP Message Server properties. - * + * * @return the messageServerProperties value. */ public MessageServerProperties messageServerProperties() { @@ -101,7 +155,7 @@ public MessageServerProperties messageServerProperties() { /** * Set the messageServerProperties property: Defines the SAP Message Server properties. - * + * * @param messageServerProperties the messageServerProperties value to set. * @return the SapCentralServerInstanceInner object itself. */ @@ -115,7 +169,7 @@ public SapCentralServerInstanceInner withMessageServerProperties(MessageServerPr /** * Get the enqueueServerProperties property: Defines the SAP Enqueue Server properties. - * + * * @return the enqueueServerProperties value. */ public EnqueueServerProperties enqueueServerProperties() { @@ -124,7 +178,7 @@ public EnqueueServerProperties enqueueServerProperties() { /** * Set the enqueueServerProperties property: Defines the SAP Enqueue Server properties. - * + * * @param enqueueServerProperties the enqueueServerProperties value to set. * @return the SapCentralServerInstanceInner object itself. */ @@ -138,7 +192,7 @@ public SapCentralServerInstanceInner withEnqueueServerProperties(EnqueueServerPr /** * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. - * + * * @return the gatewayServerProperties value. */ public GatewayServerProperties gatewayServerProperties() { @@ -147,7 +201,7 @@ public GatewayServerProperties gatewayServerProperties() { /** * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. - * + * * @param gatewayServerProperties the gatewayServerProperties value to set. * @return the SapCentralServerInstanceInner object itself. */ @@ -161,7 +215,7 @@ public SapCentralServerInstanceInner withGatewayServerProperties(GatewayServerPr /** * Get the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. - * + * * @return the enqueueReplicationServerProperties value. */ public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { @@ -170,12 +224,12 @@ public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { /** * Set the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. - * + * * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. * @return the SapCentralServerInstanceInner object itself. */ - public SapCentralServerInstanceInner withEnqueueReplicationServerProperties( - EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + public SapCentralServerInstanceInner + withEnqueueReplicationServerProperties(EnqueueReplicationServerProperties enqueueReplicationServerProperties) { if (this.innerProperties() == null) { this.innerProperties = new SapCentralServerProperties(); } @@ -185,7 +239,7 @@ public SapCentralServerInstanceInner withEnqueueReplicationServerProperties( /** * Get the kernelVersion property: The central services instance Kernel Version. - * + * * @return the kernelVersion value. */ public String kernelVersion() { @@ -194,7 +248,7 @@ public String kernelVersion() { /** * Get the kernelPatch property: The central services instance Kernel Patch level. - * + * * @return the kernelPatch value. */ public String kernelPatch() { @@ -204,7 +258,7 @@ public String kernelPatch() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual * Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -213,7 +267,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines corresponding to the Central Services instance. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -222,7 +276,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -231,7 +285,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -240,7 +294,7 @@ public SapHealthState health() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -249,7 +303,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the errors related to SAP Central Services Instance resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -258,7 +312,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -266,4 +320,58 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapCentralServerInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapCentralServerInstanceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapCentralServerInstanceInner. + */ + public static SapCentralServerInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapCentralServerInstanceInner deserializedSapCentralServerInstanceInner + = new SapCentralServerInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSapCentralServerInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.innerProperties + = SapCentralServerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSapCentralServerInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapCentralServerInstanceInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerProperties.java index e4d78073d613..6a456c01333e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerProperties.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; import com.azure.resourcemanager.workloads.models.EnqueueReplicationServerProperties; import com.azure.resourcemanager.workloads.models.EnqueueServerProperties; @@ -15,103 +19,93 @@ import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the SAP Central Services Instance properties. */ +/** + * Defines the SAP Central Services Instance properties. + */ @Fluent -public final class SapCentralServerProperties { +public final class SapCentralServerProperties implements JsonSerializable { /* * The central services instance number. */ - @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) private String instanceNo; /* * The central services instance subnet. */ - @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) private String subnet; /* * Defines the SAP Message Server properties. */ - @JsonProperty(value = "messageServerProperties") private MessageServerProperties messageServerProperties; /* * Defines the SAP Enqueue Server properties. */ - @JsonProperty(value = "enqueueServerProperties") private EnqueueServerProperties enqueueServerProperties; /* * Defines the SAP Gateway Server properties. */ - @JsonProperty(value = "gatewayServerProperties") private GatewayServerProperties gatewayServerProperties; /* * Defines the SAP Enqueue Replication Server (ERS) properties. */ - @JsonProperty(value = "enqueueReplicationServerProperties") private EnqueueReplicationServerProperties enqueueReplicationServerProperties; /* * The central services instance Kernel Version. */ - @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) private String kernelVersion; /* * The central services instance Kernel Patch level. */ - @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) private String kernelPatch; /* * The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines */ - @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) private LoadBalancerDetails loadBalancerDetails; /* * The list of virtual machines corresponding to the Central Services instance. */ - @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) private List vmDetails; /* * Defines the SAP Instance status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceStatus status; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; /* * Defines the provisioning states. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceProvisioningState provisioningState; /* * Defines the errors related to SAP Central Services Instance resource. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceError errors; - /** Creates an instance of SapCentralServerProperties class. */ + /** + * Creates an instance of SapCentralServerProperties class. + */ public SapCentralServerProperties() { } /** * Get the instanceNo property: The central services instance number. - * + * * @return the instanceNo value. */ public String instanceNo() { @@ -120,7 +114,7 @@ public String instanceNo() { /** * Get the subnet property: The central services instance subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -129,7 +123,7 @@ public String subnet() { /** * Get the messageServerProperties property: Defines the SAP Message Server properties. - * + * * @return the messageServerProperties value. */ public MessageServerProperties messageServerProperties() { @@ -138,7 +132,7 @@ public MessageServerProperties messageServerProperties() { /** * Set the messageServerProperties property: Defines the SAP Message Server properties. - * + * * @param messageServerProperties the messageServerProperties value to set. * @return the SapCentralServerProperties object itself. */ @@ -149,7 +143,7 @@ public SapCentralServerProperties withMessageServerProperties(MessageServerPrope /** * Get the enqueueServerProperties property: Defines the SAP Enqueue Server properties. - * + * * @return the enqueueServerProperties value. */ public EnqueueServerProperties enqueueServerProperties() { @@ -158,7 +152,7 @@ public EnqueueServerProperties enqueueServerProperties() { /** * Set the enqueueServerProperties property: Defines the SAP Enqueue Server properties. - * + * * @param enqueueServerProperties the enqueueServerProperties value to set. * @return the SapCentralServerProperties object itself. */ @@ -169,7 +163,7 @@ public SapCentralServerProperties withEnqueueServerProperties(EnqueueServerPrope /** * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. - * + * * @return the gatewayServerProperties value. */ public GatewayServerProperties gatewayServerProperties() { @@ -178,7 +172,7 @@ public GatewayServerProperties gatewayServerProperties() { /** * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. - * + * * @param gatewayServerProperties the gatewayServerProperties value to set. * @return the SapCentralServerProperties object itself. */ @@ -189,7 +183,7 @@ public SapCentralServerProperties withGatewayServerProperties(GatewayServerPrope /** * Get the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. - * + * * @return the enqueueReplicationServerProperties value. */ public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { @@ -198,19 +192,19 @@ public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { /** * Set the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. - * + * * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. * @return the SapCentralServerProperties object itself. */ - public SapCentralServerProperties withEnqueueReplicationServerProperties( - EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + public SapCentralServerProperties + withEnqueueReplicationServerProperties(EnqueueReplicationServerProperties enqueueReplicationServerProperties) { this.enqueueReplicationServerProperties = enqueueReplicationServerProperties; return this; } /** * Get the kernelVersion property: The central services instance Kernel Version. - * + * * @return the kernelVersion value. */ public String kernelVersion() { @@ -219,7 +213,7 @@ public String kernelVersion() { /** * Get the kernelPatch property: The central services instance Kernel Patch level. - * + * * @return the kernelPatch value. */ public String kernelPatch() { @@ -229,7 +223,7 @@ public String kernelPatch() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual * Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -238,7 +232,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines corresponding to the Central Services instance. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -247,7 +241,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -256,7 +250,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -265,7 +259,7 @@ public SapHealthState health() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -274,7 +268,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the errors related to SAP Central Services Instance resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -283,7 +277,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -309,4 +303,77 @@ public void validate() { errors().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("messageServerProperties", this.messageServerProperties); + jsonWriter.writeJsonField("enqueueServerProperties", this.enqueueServerProperties); + jsonWriter.writeJsonField("gatewayServerProperties", this.gatewayServerProperties); + jsonWriter.writeJsonField("enqueueReplicationServerProperties", this.enqueueReplicationServerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapCentralServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapCentralServerProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapCentralServerProperties. + */ + public static SapCentralServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapCentralServerProperties deserializedSapCentralServerProperties = new SapCentralServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceNo".equals(fieldName)) { + deserializedSapCentralServerProperties.instanceNo = reader.getString(); + } else if ("subnet".equals(fieldName)) { + deserializedSapCentralServerProperties.subnet = reader.getString(); + } else if ("messageServerProperties".equals(fieldName)) { + deserializedSapCentralServerProperties.messageServerProperties + = MessageServerProperties.fromJson(reader); + } else if ("enqueueServerProperties".equals(fieldName)) { + deserializedSapCentralServerProperties.enqueueServerProperties + = EnqueueServerProperties.fromJson(reader); + } else if ("gatewayServerProperties".equals(fieldName)) { + deserializedSapCentralServerProperties.gatewayServerProperties + = GatewayServerProperties.fromJson(reader); + } else if ("enqueueReplicationServerProperties".equals(fieldName)) { + deserializedSapCentralServerProperties.enqueueReplicationServerProperties + = EnqueueReplicationServerProperties.fromJson(reader); + } else if ("kernelVersion".equals(fieldName)) { + deserializedSapCentralServerProperties.kernelVersion = reader.getString(); + } else if ("kernelPatch".equals(fieldName)) { + deserializedSapCentralServerProperties.kernelPatch = reader.getString(); + } else if ("loadBalancerDetails".equals(fieldName)) { + deserializedSapCentralServerProperties.loadBalancerDetails = LoadBalancerDetails.fromJson(reader); + } else if ("vmDetails".equals(fieldName)) { + List vmDetails + = reader.readArray(reader1 -> CentralServerVmDetails.fromJson(reader1)); + deserializedSapCentralServerProperties.vmDetails = vmDetails; + } else if ("status".equals(fieldName)) { + deserializedSapCentralServerProperties.status + = SapVirtualInstanceStatus.fromString(reader.getString()); + } else if ("health".equals(fieldName)) { + deserializedSapCentralServerProperties.health = SapHealthState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSapCentralServerProperties.provisioningState + = SapVirtualInstanceProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedSapCentralServerProperties.errors = SapVirtualInstanceError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapCentralServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseInstanceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseInstanceInner.java index 297adc819c98..042968e45199 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseInstanceInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseInstanceInner.java @@ -7,37 +7,57 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; import com.azure.resourcemanager.workloads.models.LoadBalancerDetails; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Define the Database resource. */ +/** + * Define the Database resource. + */ @Fluent public final class SapDatabaseInstanceInner extends Resource { /* * Defines the Database properties. */ - @JsonProperty(value = "properties") private SapDatabaseProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of SapDatabaseInstanceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SapDatabaseInstanceInner class. + */ public SapDatabaseInstanceInner() { } /** * Get the innerProperties property: Defines the Database properties. - * + * * @return the innerProperties value. */ private SapDatabaseProperties innerProperties() { @@ -46,21 +66,55 @@ private SapDatabaseProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public SapDatabaseInstanceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SapDatabaseInstanceInner withTags(Map tags) { super.withTags(tags); @@ -69,7 +123,7 @@ public SapDatabaseInstanceInner withTags(Map tags) { /** * Get the subnet property: Database subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -78,7 +132,7 @@ public String subnet() { /** * Get the databaseSid property: Database SID name. - * + * * @return the databaseSid value. */ public String databaseSid() { @@ -88,7 +142,7 @@ public String databaseSid() { /** * Get the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL * Server. - * + * * @return the databaseType value. */ public String databaseType() { @@ -97,7 +151,7 @@ public String databaseType() { /** * Get the ipAddress property: Database IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -107,7 +161,7 @@ public String ipAddress() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database * Virtual Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -116,7 +170,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines corresponding to the Database resource. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -125,7 +179,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -134,7 +188,7 @@ public SapVirtualInstanceStatus status() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -143,7 +197,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the errors related to Database resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -152,7 +206,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -160,4 +214,56 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDatabaseInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDatabaseInstanceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapDatabaseInstanceInner. + */ + public static SapDatabaseInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDatabaseInstanceInner deserializedSapDatabaseInstanceInner = new SapDatabaseInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSapDatabaseInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.innerProperties = SapDatabaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSapDatabaseInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapDatabaseInstanceInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseProperties.java index 72dafff00b38..024eb27ba1ad 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseProperties.java @@ -5,78 +5,77 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; import com.azure.resourcemanager.workloads.models.LoadBalancerDetails; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the Database properties. */ +/** + * Defines the Database properties. + */ @Immutable -public final class SapDatabaseProperties { +public final class SapDatabaseProperties implements JsonSerializable { /* * Database subnet. */ - @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) private String subnet; /* * Database SID name. */ - @JsonProperty(value = "databaseSid", access = JsonProperty.Access.WRITE_ONLY) private String databaseSid; /* * Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. */ - @JsonProperty(value = "databaseType", access = JsonProperty.Access.WRITE_ONLY) private String databaseType; /* * Database IP Address. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines */ - @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) private LoadBalancerDetails loadBalancerDetails; /* * The list of virtual machines corresponding to the Database resource. */ - @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) private List vmDetails; /* * Defines the SAP Instance status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceStatus status; /* * Defines the provisioning states. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceProvisioningState provisioningState; /* * Defines the errors related to Database resource. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceError errors; - /** Creates an instance of SapDatabaseProperties class. */ + /** + * Creates an instance of SapDatabaseProperties class. + */ public SapDatabaseProperties() { } /** * Get the subnet property: Database subnet. - * + * * @return the subnet value. */ public String subnet() { @@ -85,7 +84,7 @@ public String subnet() { /** * Get the databaseSid property: Database SID name. - * + * * @return the databaseSid value. */ public String databaseSid() { @@ -95,7 +94,7 @@ public String databaseSid() { /** * Get the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL * Server. - * + * * @return the databaseType value. */ public String databaseType() { @@ -104,7 +103,7 @@ public String databaseType() { /** * Get the ipAddress property: Database IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -114,7 +113,7 @@ public String ipAddress() { /** * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database * Virtual Machines. - * + * * @return the loadBalancerDetails value. */ public LoadBalancerDetails loadBalancerDetails() { @@ -123,7 +122,7 @@ public LoadBalancerDetails loadBalancerDetails() { /** * Get the vmDetails property: The list of virtual machines corresponding to the Database resource. - * + * * @return the vmDetails value. */ public List vmDetails() { @@ -132,7 +131,7 @@ public List vmDetails() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -141,7 +140,7 @@ public SapVirtualInstanceStatus status() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -150,7 +149,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Defines the errors related to Database resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -159,7 +158,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -173,4 +172,58 @@ public void validate() { errors().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDatabaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDatabaseProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapDatabaseProperties. + */ + public static SapDatabaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDatabaseProperties deserializedSapDatabaseProperties = new SapDatabaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedSapDatabaseProperties.subnet = reader.getString(); + } else if ("databaseSid".equals(fieldName)) { + deserializedSapDatabaseProperties.databaseSid = reader.getString(); + } else if ("databaseType".equals(fieldName)) { + deserializedSapDatabaseProperties.databaseType = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedSapDatabaseProperties.ipAddress = reader.getString(); + } else if ("loadBalancerDetails".equals(fieldName)) { + deserializedSapDatabaseProperties.loadBalancerDetails = LoadBalancerDetails.fromJson(reader); + } else if ("vmDetails".equals(fieldName)) { + List vmDetails + = reader.readArray(reader1 -> DatabaseVmDetails.fromJson(reader1)); + deserializedSapDatabaseProperties.vmDetails = vmDetails; + } else if ("status".equals(fieldName)) { + deserializedSapDatabaseProperties.status = SapVirtualInstanceStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSapDatabaseProperties.provisioningState + = SapVirtualInstanceProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedSapDatabaseProperties.errors = SapVirtualInstanceError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapDatabaseProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDiskConfigurationsResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDiskConfigurationsResultInner.java index 58f12f42a97d..d2e8752e9ba1 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDiskConfigurationsResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDiskConfigurationsResultInner.java @@ -5,30 +5,35 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.SapDiskConfiguration; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The list of disk configuration for vmSku which are part of SAP deployment. */ +/** + * The list of disk configuration for vmSku which are part of SAP deployment. + */ @Fluent -public final class SapDiskConfigurationsResultInner { +public final class SapDiskConfigurationsResultInner implements JsonSerializable { /* - * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', - * hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', + * 'usr/sap', 'os'], Optional volume : ['backup']. */ - @JsonProperty(value = "volumeConfigurations") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map volumeConfigurations; - /** Creates an instance of SapDiskConfigurationsResultInner class. */ + /** + * Creates an instance of SapDiskConfigurationsResultInner class. + */ public SapDiskConfigurationsResultInner() { } /** * Get the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. - * + * * @return the volumeConfigurations value. */ public Map volumeConfigurations() { @@ -38,31 +43,68 @@ public Map volumeConfigurations() { /** * Set the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. - * + * * @param volumeConfigurations the volumeConfigurations value to set. * @return the SapDiskConfigurationsResultInner object itself. */ - public SapDiskConfigurationsResultInner withVolumeConfigurations( - Map volumeConfigurations) { + public SapDiskConfigurationsResultInner + withVolumeConfigurations(Map volumeConfigurations) { this.volumeConfigurations = volumeConfigurations; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (volumeConfigurations() != null) { - volumeConfigurations() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + volumeConfigurations().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("volumeConfigurations", this.volumeConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDiskConfigurationsResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDiskConfigurationsResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapDiskConfigurationsResultInner. + */ + public static SapDiskConfigurationsResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDiskConfigurationsResultInner deserializedSapDiskConfigurationsResultInner + = new SapDiskConfigurationsResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("volumeConfigurations".equals(fieldName)) { + Map volumeConfigurations + = reader.readMap(reader1 -> SapDiskConfiguration.fromJson(reader1)); + deserializedSapDiskConfigurationsResultInner.volumeConfigurations = volumeConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedSapDiskConfigurationsResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorInner.java index be8cbc10ad77..9e536d9c9187 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorInner.java @@ -7,34 +7,54 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** configuration associated with SAP Landscape Monitor Dashboard. */ +/** + * configuration associated with SAP Landscape Monitor Dashboard. + */ @Fluent public final class SapLandscapeMonitorInner extends ProxyResource { /* * Sap Landscape Monitor properties */ - @JsonProperty(value = "properties") private SapLandscapeMonitorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of SapLandscapeMonitorInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SapLandscapeMonitorInner class. + */ public SapLandscapeMonitorInner() { } /** * Get the innerProperties property: Sap Landscape Monitor properties. - * + * * @return the innerProperties value. */ private SapLandscapeMonitorProperties innerProperties() { @@ -43,16 +63,46 @@ private SapLandscapeMonitorProperties innerProperties() { /** * 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 id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ public SapLandscapeMonitorProvisioningState provisioningState() { @@ -61,7 +111,7 @@ public SapLandscapeMonitorProvisioningState provisioningState() { /** * Get the grouping property: Gets or sets the SID groupings by landscape and Environment. - * + * * @return the grouping value. */ public SapLandscapeMonitorPropertiesGrouping grouping() { @@ -70,7 +120,7 @@ public SapLandscapeMonitorPropertiesGrouping grouping() { /** * Set the grouping property: Gets or sets the SID groupings by landscape and Environment. - * + * * @param grouping the grouping value to set. * @return the SapLandscapeMonitorInner object itself. */ @@ -85,7 +135,7 @@ public SapLandscapeMonitorInner withGrouping(SapLandscapeMonitorPropertiesGroupi /** * Get the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor * Dashboard. - * + * * @return the topMetricsThresholds value. */ public List topMetricsThresholds() { @@ -95,12 +145,12 @@ public List topMetricsThresholds() { /** * Set the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor * Dashboard. - * + * * @param topMetricsThresholds the topMetricsThresholds value to set. * @return the SapLandscapeMonitorInner object itself. */ - public SapLandscapeMonitorInner withTopMetricsThresholds( - List topMetricsThresholds) { + public SapLandscapeMonitorInner + withTopMetricsThresholds(List topMetricsThresholds) { if (this.innerProperties() == null) { this.innerProperties = new SapLandscapeMonitorProperties(); } @@ -110,7 +160,7 @@ public SapLandscapeMonitorInner withTopMetricsThresholds( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +168,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorInner. + */ + public static SapLandscapeMonitorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorInner deserializedSapLandscapeMonitorInner = new SapLandscapeMonitorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapLandscapeMonitorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapLandscapeMonitorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapLandscapeMonitorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSapLandscapeMonitorInner.innerProperties + = SapLandscapeMonitorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSapLandscapeMonitorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorListResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorListResultInner.java index 913ca7454799..b9e13ee9efb1 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorListResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorListResultInner.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The response from the List SAP Landscape Monitor Dashboard operation. */ +/** + * The response from the List SAP Landscape Monitor Dashboard operation. + */ @Fluent -public final class SapLandscapeMonitorListResultInner { +public final class SapLandscapeMonitorListResultInner implements JsonSerializable { /* * The list of Sap Landscape Monitor configuration. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of SAP Landscape Monitor Dashboard. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of SapLandscapeMonitorListResultInner class. */ + /** + * Creates an instance of SapLandscapeMonitorListResultInner class. + */ public SapLandscapeMonitorListResultInner() { } /** * Get the value property: The list of Sap Landscape Monitor configuration. - * + * * @return the value value. */ public List value() { @@ -38,7 +44,7 @@ public List value() { /** * Set the value property: The list of Sap Landscape Monitor configuration. - * + * * @param value the value value to set. * @return the SapLandscapeMonitorListResultInner object itself. */ @@ -49,7 +55,7 @@ public SapLandscapeMonitorListResultInner withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorListResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorListResultInner. + */ + public static SapLandscapeMonitorListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorListResultInner deserializedSapLandscapeMonitorListResultInner + = new SapLandscapeMonitorListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SapLandscapeMonitorInner.fromJson(reader1)); + deserializedSapLandscapeMonitorListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSapLandscapeMonitorListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorListResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorProperties.java index 9be9f2158056..aae84752c65c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapLandscapeMonitorProperties.java @@ -5,40 +5,45 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Gets or sets the properties for Sap Landscape Monitor Dashboard. */ +/** + * Gets or sets the properties for Sap Landscape Monitor Dashboard. + */ @Fluent -public final class SapLandscapeMonitorProperties { +public final class SapLandscapeMonitorProperties implements JsonSerializable { /* * State of provisioning of the SAP monitor. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private SapLandscapeMonitorProvisioningState provisioningState; /* * Gets or sets the SID groupings by landscape and Environment. */ - @JsonProperty(value = "grouping") private SapLandscapeMonitorPropertiesGrouping grouping; /* * Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor Dashboard */ - @JsonProperty(value = "topMetricsThresholds") private List topMetricsThresholds; - /** Creates an instance of SapLandscapeMonitorProperties class. */ + /** + * Creates an instance of SapLandscapeMonitorProperties class. + */ public SapLandscapeMonitorProperties() { } /** * Get the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ public SapLandscapeMonitorProvisioningState provisioningState() { @@ -47,7 +52,7 @@ public SapLandscapeMonitorProvisioningState provisioningState() { /** * Get the grouping property: Gets or sets the SID groupings by landscape and Environment. - * + * * @return the grouping value. */ public SapLandscapeMonitorPropertiesGrouping grouping() { @@ -56,7 +61,7 @@ public SapLandscapeMonitorPropertiesGrouping grouping() { /** * Set the grouping property: Gets or sets the SID groupings by landscape and Environment. - * + * * @param grouping the grouping value to set. * @return the SapLandscapeMonitorProperties object itself. */ @@ -68,7 +73,7 @@ public SapLandscapeMonitorProperties withGrouping(SapLandscapeMonitorPropertiesG /** * Get the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor * Dashboard. - * + * * @return the topMetricsThresholds value. */ public List topMetricsThresholds() { @@ -78,19 +83,19 @@ public List topMetricsThresholds() { /** * Set the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor * Dashboard. - * + * * @param topMetricsThresholds the topMetricsThresholds value to set. * @return the SapLandscapeMonitorProperties object itself. */ - public SapLandscapeMonitorProperties withTopMetricsThresholds( - List topMetricsThresholds) { + public SapLandscapeMonitorProperties + withTopMetricsThresholds(List topMetricsThresholds) { this.topMetricsThresholds = topMetricsThresholds; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -101,4 +106,51 @@ public void validate() { topMetricsThresholds().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("grouping", this.grouping); + jsonWriter.writeArrayField("topMetricsThresholds", this.topMetricsThresholds, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorProperties. + */ + public static SapLandscapeMonitorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorProperties deserializedSapLandscapeMonitorProperties + = new SapLandscapeMonitorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSapLandscapeMonitorProperties.provisioningState + = SapLandscapeMonitorProvisioningState.fromString(reader.getString()); + } else if ("grouping".equals(fieldName)) { + deserializedSapLandscapeMonitorProperties.grouping + = SapLandscapeMonitorPropertiesGrouping.fromJson(reader); + } else if ("topMetricsThresholds".equals(fieldName)) { + List topMetricsThresholds + = reader.readArray(reader1 -> SapLandscapeMonitorMetricThresholds.fromJson(reader1)); + deserializedSapLandscapeMonitorProperties.topMetricsThresholds = topMetricsThresholds; + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSizingRecommendationResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSizingRecommendationResultInner.java index 352fb140eed6..05409db5fabf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSizingRecommendationResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSizingRecommendationResultInner.java @@ -5,34 +5,111 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; import com.azure.resourcemanager.workloads.models.SingleServerRecommendationResult; import com.azure.resourcemanager.workloads.models.ThreeTierRecommendationResult; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The SAP sizing recommendation result. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "deploymentType", - defaultImpl = SapSizingRecommendationResultInner.class) -@JsonTypeName("SapSizingRecommendationResult") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "SingleServer", value = SingleServerRecommendationResult.class), - @JsonSubTypes.Type(name = "ThreeTier", value = ThreeTierRecommendationResult.class) -}) +import java.io.IOException; + +/** + * The SAP sizing recommendation result. + */ @Immutable -public class SapSizingRecommendationResultInner { - /** Creates an instance of SapSizingRecommendationResultInner class. */ +public class SapSizingRecommendationResultInner implements JsonSerializable { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.fromString("SapSizingRecommendationResult"); + + /** + * Creates an instance of SapSizingRecommendationResultInner class. + */ public SapSizingRecommendationResultInner() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSizingRecommendationResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSizingRecommendationResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapSizingRecommendationResultInner. + */ + public static SapSizingRecommendationResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("deploymentType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SingleServer".equals(discriminatorValue)) { + return SingleServerRecommendationResult.fromJson(readerToUse.reset()); + } else if ("ThreeTier".equals(discriminatorValue)) { + return ThreeTierRecommendationResult.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SapSizingRecommendationResultInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSizingRecommendationResultInner deserializedSapSizingRecommendationResultInner + = new SapSizingRecommendationResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentType".equals(fieldName)) { + deserializedSapSizingRecommendationResultInner.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSizingRecommendationResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSupportedResourceSkusResultInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSupportedResourceSkusResultInner.java index db246502d4d5..f120dcd319fe 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSupportedResourceSkusResultInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSupportedResourceSkusResultInner.java @@ -5,26 +5,34 @@ package com.azure.resourcemanager.workloads.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.SapSupportedSku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The list of supported SKUs for different resources which are part of SAP deployment. */ +/** + * The list of supported SKUs for different resources which are part of SAP deployment. + */ @Fluent -public final class SapSupportedResourceSkusResultInner { +public final class SapSupportedResourceSkusResultInner + implements JsonSerializable { /* * Gets the list of SAP supported SKUs. */ - @JsonProperty(value = "supportedSkus") private List supportedSkus; - /** Creates an instance of SapSupportedResourceSkusResultInner class. */ + /** + * Creates an instance of SapSupportedResourceSkusResultInner class. + */ public SapSupportedResourceSkusResultInner() { } /** * Get the supportedSkus property: Gets the list of SAP supported SKUs. - * + * * @return the supportedSkus value. */ public List supportedSkus() { @@ -33,7 +41,7 @@ public List supportedSkus() { /** * Set the supportedSkus property: Gets the list of SAP supported SKUs. - * + * * @param supportedSkus the supportedSkus value to set. * @return the SapSupportedResourceSkusResultInner object itself. */ @@ -44,7 +52,7 @@ public SapSupportedResourceSkusResultInner withSupportedSkus(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("supportedSkus", this.supportedSkus, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSupportedResourceSkusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSupportedResourceSkusResultInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapSupportedResourceSkusResultInner. + */ + public static SapSupportedResourceSkusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSupportedResourceSkusResultInner deserializedSapSupportedResourceSkusResultInner + = new SapSupportedResourceSkusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportedSkus".equals(fieldName)) { + List supportedSkus + = reader.readArray(reader1 -> SapSupportedSku.fromJson(reader1)); + deserializedSapSupportedResourceSkusResultInner.supportedSkus = supportedSkus; + } else { + reader.skipChildren(); + } + } + + return deserializedSapSupportedResourceSkusResultInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceInner.java index a9a5687e843f..02720283cc36 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceInner.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; import com.azure.resourcemanager.workloads.models.SapConfiguration; import com.azure.resourcemanager.workloads.models.SapEnvironmentType; @@ -18,39 +21,55 @@ import com.azure.resourcemanager.workloads.models.SapVirtualInstanceState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Define the Virtual Instance for SAP solutions resource. */ +/** + * Define the Virtual Instance for SAP solutions resource. + */ @Fluent public final class SapVirtualInstanceInner extends Resource { /* * A pre-created user assigned identity with appropriate roles assigned. To learn more on identity and roles * required, visit the ACSS how-to-guide. */ - @JsonProperty(value = "identity") private UserAssignedServiceIdentity identity; /* * Defines the Virtual Instance for SAP solutions resource properties. */ - @JsonProperty(value = "properties", required = true) private SapVirtualInstanceProperties innerProperties = new SapVirtualInstanceProperties(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of SapVirtualInstanceInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SapVirtualInstanceInner class. + */ public SapVirtualInstanceInner() { } /** * Get the identity property: A pre-created user assigned identity with appropriate roles assigned. To learn more on * identity and roles required, visit the ACSS how-to-guide. - * + * * @return the identity value. */ public UserAssignedServiceIdentity identity() { @@ -60,7 +79,7 @@ public UserAssignedServiceIdentity identity() { /** * Set the identity property: A pre-created user assigned identity with appropriate roles assigned. To learn more on * identity and roles required, visit the ACSS how-to-guide. - * + * * @param identity the identity value to set. * @return the SapVirtualInstanceInner object itself. */ @@ -71,7 +90,7 @@ public SapVirtualInstanceInner withIdentity(UserAssignedServiceIdentity identity /** * Get the innerProperties property: Defines the Virtual Instance for SAP solutions resource properties. - * + * * @return the innerProperties value. */ private SapVirtualInstanceProperties innerProperties() { @@ -80,21 +99,55 @@ private SapVirtualInstanceProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public SapVirtualInstanceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SapVirtualInstanceInner withTags(Map tags) { super.withTags(tags); @@ -103,7 +156,7 @@ public SapVirtualInstanceInner withTags(Map tags) { /** * Get the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ public SapEnvironmentType environment() { @@ -112,7 +165,7 @@ public SapEnvironmentType environment() { /** * Set the environment property: Defines the environment type - Production/Non Production. - * + * * @param environment the environment value to set. * @return the SapVirtualInstanceInner object itself. */ @@ -126,7 +179,7 @@ public SapVirtualInstanceInner withEnvironment(SapEnvironmentType environment) { /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -135,7 +188,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapVirtualInstanceInner object itself. */ @@ -150,7 +203,7 @@ public SapVirtualInstanceInner withSapProduct(SapProductType sapProduct) { /** * Get the configuration property: Defines if the SAP system is being created using Azure Center for SAP solutions * (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @return the configuration value. */ public SapConfiguration configuration() { @@ -160,7 +213,7 @@ public SapConfiguration configuration() { /** * Set the configuration property: Defines if the SAP system is being created using Azure Center for SAP solutions * (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @param configuration the configuration value to set. * @return the SapVirtualInstanceInner object itself. */ @@ -174,7 +227,7 @@ public SapVirtualInstanceInner withConfiguration(SapConfiguration configuration) /** * Get the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ public ManagedRGConfiguration managedResourceGroupConfiguration() { @@ -183,12 +236,12 @@ public ManagedRGConfiguration managedResourceGroupConfiguration() { /** * Set the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the SapVirtualInstanceInner object itself. */ - public SapVirtualInstanceInner withManagedResourceGroupConfiguration( - ManagedRGConfiguration managedResourceGroupConfiguration) { + public SapVirtualInstanceInner + withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { if (this.innerProperties() == null) { this.innerProperties = new SapVirtualInstanceProperties(); } @@ -198,7 +251,7 @@ public SapVirtualInstanceInner withManagedResourceGroupConfiguration( /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -207,7 +260,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -216,7 +269,7 @@ public SapHealthState health() { /** * Get the state property: Defines the Virtual Instance for SAP state. - * + * * @return the state value. */ public SapVirtualInstanceState state() { @@ -225,7 +278,7 @@ public SapVirtualInstanceState state() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -234,7 +287,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -243,7 +296,7 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -251,14 +304,68 @@ public void validate() { identity().validate(); } if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model SapVirtualInstanceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SapVirtualInstanceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapVirtualInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapVirtualInstanceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapVirtualInstanceInner. + */ + public static SapVirtualInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapVirtualInstanceInner deserializedSapVirtualInstanceInner = new SapVirtualInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapVirtualInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapVirtualInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapVirtualInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSapVirtualInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSapVirtualInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSapVirtualInstanceInner.innerProperties = SapVirtualInstanceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedSapVirtualInstanceInner.identity = UserAssignedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSapVirtualInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapVirtualInstanceInner; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceProperties.java index 5f68faa5ff1f..8373bea5c3bd 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceProperties.java @@ -6,6 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; import com.azure.resourcemanager.workloads.models.SapConfiguration; import com.azure.resourcemanager.workloads.models.SapEnvironmentType; @@ -15,73 +19,68 @@ import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceState; import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Defines the Virtual Instance for SAP solutions resource properties. */ +/** + * Defines the Virtual Instance for SAP solutions resource properties. + */ @Fluent -public final class SapVirtualInstanceProperties { +public final class SapVirtualInstanceProperties implements JsonSerializable { /* * Defines the environment type - Production/Non Production. */ - @JsonProperty(value = "environment", required = true) private SapEnvironmentType environment; /* * Defines the SAP Product type. */ - @JsonProperty(value = "sapProduct", required = true) private SapProductType sapProduct; /* * Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP * system is being registered with ACSS */ - @JsonProperty(value = "configuration", required = true) private SapConfiguration configuration; /* * Managed resource group configuration */ - @JsonProperty(value = "managedResourceGroupConfiguration") private ManagedRGConfiguration managedResourceGroupConfiguration; /* * Defines the SAP Instance status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceStatus status; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; /* * Defines the Virtual Instance for SAP state. */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceState state; /* * Defines the provisioning states. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceProvisioningState provisioningState; /* * Indicates any errors on the Virtual Instance for SAP solutions resource. */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceError errors; - /** Creates an instance of SapVirtualInstanceProperties class. */ + /** + * Creates an instance of SapVirtualInstanceProperties class. + */ public SapVirtualInstanceProperties() { } /** * Get the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ public SapEnvironmentType environment() { @@ -90,7 +89,7 @@ public SapEnvironmentType environment() { /** * Set the environment property: Defines the environment type - Production/Non Production. - * + * * @param environment the environment value to set. * @return the SapVirtualInstanceProperties object itself. */ @@ -101,7 +100,7 @@ public SapVirtualInstanceProperties withEnvironment(SapEnvironmentType environme /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -110,7 +109,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapVirtualInstanceProperties object itself. */ @@ -122,7 +121,7 @@ public SapVirtualInstanceProperties withSapProduct(SapProductType sapProduct) { /** * Get the configuration property: Defines if the SAP system is being created using Azure Center for SAP solutions * (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @return the configuration value. */ public SapConfiguration configuration() { @@ -132,7 +131,7 @@ public SapConfiguration configuration() { /** * Set the configuration property: Defines if the SAP system is being created using Azure Center for SAP solutions * (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @param configuration the configuration value to set. * @return the SapVirtualInstanceProperties object itself. */ @@ -143,7 +142,7 @@ public SapVirtualInstanceProperties withConfiguration(SapConfiguration configura /** * Get the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ public ManagedRGConfiguration managedResourceGroupConfiguration() { @@ -152,19 +151,19 @@ public ManagedRGConfiguration managedResourceGroupConfiguration() { /** * Set the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. * @return the SapVirtualInstanceProperties object itself. */ - public SapVirtualInstanceProperties withManagedResourceGroupConfiguration( - ManagedRGConfiguration managedResourceGroupConfiguration) { + public SapVirtualInstanceProperties + withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; return this; } /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -173,7 +172,7 @@ public SapVirtualInstanceStatus status() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -182,7 +181,7 @@ public SapHealthState health() { /** * Get the state property: Defines the Virtual Instance for SAP state. - * + * * @return the state value. */ public SapVirtualInstanceState state() { @@ -191,7 +190,7 @@ public SapVirtualInstanceState state() { /** * Get the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ public SapVirtualInstanceProvisioningState provisioningState() { @@ -200,7 +199,7 @@ public SapVirtualInstanceProvisioningState provisioningState() { /** * Get the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. - * + * * @return the errors value. */ public SapVirtualInstanceError errors() { @@ -209,27 +208,24 @@ public SapVirtualInstanceError errors() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (environment() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environment in model SapVirtualInstanceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property environment in model SapVirtualInstanceProperties")); } if (sapProduct() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapProduct in model SapVirtualInstanceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapProduct in model SapVirtualInstanceProperties")); } if (configuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property configuration in model SapVirtualInstanceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property configuration in model SapVirtualInstanceProperties")); } else { configuration().validate(); } @@ -242,4 +238,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); + jsonWriter.writeStringField("sapProduct", this.sapProduct == null ? null : this.sapProduct.toString()); + jsonWriter.writeJsonField("configuration", this.configuration); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapVirtualInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapVirtualInstanceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapVirtualInstanceProperties. + */ + public static SapVirtualInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapVirtualInstanceProperties deserializedSapVirtualInstanceProperties = new SapVirtualInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environment".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.environment + = SapEnvironmentType.fromString(reader.getString()); + } else if ("sapProduct".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.sapProduct = SapProductType.fromString(reader.getString()); + } else if ("configuration".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.configuration = SapConfiguration.fromJson(reader); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.managedResourceGroupConfiguration + = ManagedRGConfiguration.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.status + = SapVirtualInstanceStatus.fromString(reader.getString()); + } else if ("health".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.health = SapHealthState.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.state + = SapVirtualInstanceState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.provisioningState + = SapVirtualInstanceProvisioningState.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + deserializedSapVirtualInstanceProperties.errors = SapVirtualInstanceError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapVirtualInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/package-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/package-info.java index 809d5997de4e..949b4366de4d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/package-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/package-info.java @@ -3,10 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for WorkloadsClient. Workloads client provides access to various workload - * operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - * - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Package containing the inner data models for WorkloadsClient. + * Workloads client provides access to various workload operations. */ package com.azure.resourcemanager.workloads.fluent.models; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/package-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/package-info.java index 4c1695317f2e..548ccb65b10c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/package-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/package-info.java @@ -3,10 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for WorkloadsClient. Workloads client provides access to various workload - * operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - * - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Package containing the service clients for WorkloadsClient. + * Workloads client provides access to various workload operations. */ package com.azure.resourcemanager.workloads.fluent; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorImpl.java index 753da3f2929f..7c087515637a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorImpl.java @@ -128,20 +128,16 @@ public MonitorImpl withExistingResourceGroup(String resourceGroupName) { } public Monitor create() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .create(resourceGroupName, monitorName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .create(resourceGroupName, monitorName, this.innerModel(), Context.NONE); return this; } public Monitor create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .create(resourceGroupName, monitorName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .create(resourceGroupName, monitorName, this.innerModel(), context); return this; } @@ -157,49 +153,41 @@ public MonitorImpl update() { } public Monitor apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateBody, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateBody, Context.NONE) + .getValue(); return this; } public Monitor apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateBody, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateBody, context) + .getValue(); return this; } MonitorImpl(MonitorInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "monitors"); } public Monitor refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE) + .getValue(); return this; } public Monitor refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMonitors() - .getByResourceGroupWithResponse(resourceGroupName, monitorName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, context) + .getValue(); return this; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsClientImpl.java index 2f7240e2954a..43d09b5244e7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsClientImpl.java @@ -41,17 +41,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in MonitorsClient. + */ public final class MonitorsClientImpl implements MonitorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MonitorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of MonitorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MonitorsClientImpl(WorkloadsClientImpl client) { @@ -66,210 +72,145 @@ public final class MonitorsClientImpl implements MonitorsClient { @Host("{$host}") @ServiceInterface(name = "WorkloadsClientMonit") public interface MonitorsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/monitors") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") MonitorInner monitorParameter, - @HeaderParam("Accept") String accept, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MonitorInner monitorParameter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @BodyParam("application/json") UpdateMonitorRequest body, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") UpdateMonitorRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedFlux}. @@ -281,10 +222,10 @@ private PagedFlux listAsync() { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -293,16 +234,16 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. @@ -314,10 +255,10 @@ public PagedIterable list() { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -331,29 +272,25 @@ public PagedIterable list(Context context) { /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -361,55 +298,36 @@ private Mono> listByResourceGroupSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -418,29 +336,17 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -449,16 +355,15 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -468,16 +373,15 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -491,9 +395,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -508,31 +412,27 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String monitorName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -543,25 +443,16 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -569,22 +460,18 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -595,29 +482,22 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String monitorName) { @@ -627,9 +507,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -637,19 +517,19 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block(); } /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -664,9 +544,9 @@ public MonitorInner getByResourceGroup(String resourceGroupName, String monitorN /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -674,22 +554,18 @@ public MonitorInner getByResourceGroup(String resourceGroupName, String monitorN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + private Mono>> createWithResponseAsync(String resourceGroupName, String monitorName, + MonitorInner monitorParameter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -706,26 +582,16 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - monitorParameter, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, monitorParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -734,22 +600,18 @@ private Mono>> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String monitorName, + MonitorInner monitorParameter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -766,23 +628,15 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - monitorParameter, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, monitorParameter, accept, context); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -790,24 +644,22 @@ private Mono>> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MonitorInner> beginCreateAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, monitorName, monitorParameter); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MonitorInner.class, MonitorInner.class, this.client.getContext()); + private PollerFlux, MonitorInner> beginCreateAsync(String resourceGroupName, + String monitorName, MonitorInner monitorParameter) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, monitorName, monitorParameter); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MonitorInner.class, MonitorInner.class, this.client.getContext()); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -816,25 +668,23 @@ private PollerFlux, MonitorInner> beginCreateAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MonitorInner> beginCreateAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + private PollerFlux, MonitorInner> beginCreateAsync(String resourceGroupName, + String monitorName, MonitorInner monitorParameter, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, monitorName, monitorParameter, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), MonitorInner.class, MonitorInner.class, context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, monitorName, monitorParameter, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MonitorInner.class, MonitorInner.class, context); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -842,19 +692,19 @@ private PollerFlux, MonitorInner> beginCreateAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MonitorInner> beginCreate( - String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + public SyncPoller, MonitorInner> beginCreate(String resourceGroupName, String monitorName, + MonitorInner monitorParameter) { return this.beginCreateAsync(resourceGroupName, monitorName, monitorParameter).getSyncPoller(); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -863,41 +713,40 @@ public SyncPoller, MonitorInner> beginCreate( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor - * properties). + * properties). */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MonitorInner> beginCreate( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + public SyncPoller, MonitorInner> beginCreate(String resourceGroupName, String monitorName, + MonitorInner monitorParameter, Context context) { return this.beginCreateAsync(resourceGroupName, monitorName, monitorParameter, context).getSyncPoller(); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link - * Mono}. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter) { - return beginCreateAsync(resourceGroupName, monitorName, monitorParameter) - .last() + private Mono createAsync(String resourceGroupName, String monitorName, + MonitorInner monitorParameter) { + return beginCreateAsync(resourceGroupName, monitorName, monitorParameter).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -905,22 +754,21 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link - * Mono}. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { - return beginCreateAsync(resourceGroupName, monitorName, monitorParameter, context) - .last() + private Mono createAsync(String resourceGroupName, String monitorName, MonitorInner monitorParameter, + Context context) { + return beginCreateAsync(resourceGroupName, monitorName, monitorParameter, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -936,9 +784,9 @@ public MonitorInner create(String resourceGroupName, String monitorName, Monitor /** * Creates a SAP monitor. - * - *

Creates a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param monitorParameter Request body representing a SAP monitor. @@ -949,37 +797,33 @@ public MonitorInner create(String resourceGroupName, String monitorName, Monitor * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). */ @ServiceMethod(returns = ReturnType.SINGLE) - public MonitorInner create( - String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + public MonitorInner create(String resourceGroupName, String monitorName, MonitorInner monitorParameter, + Context context) { return createAsync(resourceGroupName, monitorName, monitorParameter, context).block(); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -990,48 +834,35 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1042,22 +873,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1066,24 +890,19 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String monitorName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String monitorName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -1093,25 +912,19 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String monitorName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String monitorName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1120,16 +933,16 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String monitorName) { return this.beginDeleteAsync(resourceGroupName, monitorName).getSyncPoller(); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -1139,16 +952,16 @@ public SyncPoller, OperationStatusResultI * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String monitorName, Context context) { return this.beginDeleteAsync(resourceGroupName, monitorName, context).getSyncPoller(); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1163,9 +976,9 @@ private Mono deleteAsync(String resourceGroupName, S /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -1175,18 +988,17 @@ private Mono deleteAsync(String resourceGroupName, S * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String monitorName, Context context) { - return beginDeleteAsync(resourceGroupName, monitorName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String monitorName, + Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1201,9 +1013,9 @@ public OperationStatusResultInner delete(String resourceGroupName, String monito /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -1219,9 +1031,9 @@ public OperationStatusResultInner delete(String resourceGroupName, String monito /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. @@ -1229,22 +1041,18 @@ public OperationStatusResultInner delete(String resourceGroupName, String monito * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, UpdateMonitorRequest body) { + private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, + UpdateMonitorRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1260,26 +1068,16 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. @@ -1288,22 +1086,18 @@ private Mono> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, UpdateMonitorRequest body, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, + UpdateMonitorRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1319,31 +1113,23 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, body, accept, context); } /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link - * Mono}. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String monitorName, UpdateMonitorRequest body) { @@ -1353,9 +1139,9 @@ private Mono updateAsync(String resourceGroupName, String monitorN /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. @@ -1366,16 +1152,16 @@ private Mono updateAsync(String resourceGroupName, String monitorN * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String monitorName, UpdateMonitorRequest body, Context context) { + public Response updateWithResponse(String resourceGroupName, String monitorName, + UpdateMonitorRequest body, Context context) { return updateWithResponseAsync(resourceGroupName, monitorName, body, context).block(); } /** * Patches the Tags field of a SAP monitor. - * - *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * + * + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param body The Update SAP workload monitor request body. @@ -1391,14 +1177,13 @@ public MonitorInner update(String resourceGroupName, String monitorName, UpdateM /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1406,37 +1191,26 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1444,36 +1218,25 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1481,38 +1244,28 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -1520,23 +1273,13 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsImpl.java index d50767189fe1..fd70d17f827f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/MonitorsImpl.java @@ -23,41 +23,38 @@ public final class MonitorsImpl implements Monitors { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public MonitorsImpl( - MonitorsClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public MonitorsImpl(MonitorsClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MonitorImpl(inner.getValue(), this.manager())); } else { return null; @@ -92,77 +89,57 @@ public OperationStatusResult delete(String resourceGroupName, String monitorName } public Monitor getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.delete(resourceGroupName, monitorName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } return this.delete(resourceGroupName, monitorName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationStatusResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationStatusResultImpl.java index da6cc885386a..fbf4e1009f85 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationStatusResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationStatusResultImpl.java @@ -17,8 +17,8 @@ public final class OperationStatusResultImpl implements OperationStatusResult { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - OperationStatusResultImpl( - OperationStatusResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -50,12 +50,9 @@ public OffsetDateTime endTime() { public List operations() { List inner = this.innerModel().operations(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsClientImpl.java index e135611e9e9f..86ba34a1ef7c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.workloads.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,99 +62,74 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "WorkloadsClientOpera") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Workloads/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all the available API operations under this PR. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all the available API operations under this PR. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all the available API operations under this PR. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -157,27 +138,27 @@ private PagedFlux listAsync() { /** * Lists all the available API operations under this PR. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all the available API operations under this PR. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +167,13 @@ public PagedIterable list() { /** * Lists all the available API operations under this PR. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -201,14 +182,13 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -216,37 +196,26 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -254,23 +223,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsImpl.java index 7132fc6ca9c3..5d52f048f959 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/OperationsImpl.java @@ -19,20 +19,20 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstanceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstanceImpl.java index 93126be0e5bc..c33b0749fc8e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstanceImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstanceImpl.java @@ -18,8 +18,8 @@ public final class ProviderInstanceImpl implements ProviderInstance, ProviderIns private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - ProviderInstanceImpl( - ProviderInstanceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + ProviderInstanceImpl(ProviderInstanceInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -77,20 +77,16 @@ public ProviderInstanceImpl withExistingMonitor(String resourceGroupName, String } public ProviderInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getProviderInstances() - .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getProviderInstances() + .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), Context.NONE); return this; } public ProviderInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getProviderInstances() - .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getProviderInstances() + .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), context); return this; } @@ -101,22 +97,18 @@ public ProviderInstance create(Context context) { } public ProviderInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getProviderInstances() - .getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE) + .getValue(); return this; } public ProviderInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getProviderInstances() - .getWithResponse(resourceGroupName, monitorName, providerInstanceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, monitorName, providerInstanceName, context) + .getValue(); return this; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesClientImpl.java index 266d98742496..fd20a9ccf51f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesClientImpl.java @@ -39,22 +39,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in ProviderInstancesClient. + */ public final class ProviderInstancesClientImpl implements ProviderInstancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ProviderInstancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of ProviderInstancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ProviderInstancesClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy.create(ProviderInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ProviderInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -65,105 +71,79 @@ public final class ProviderInstancesClientImpl implements ProviderInstancesClien @Host("{$host}") @ServiceInterface(name = "WorkloadsClientProvi") public interface ProviderInstancesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("providerInstanceName") String providerInstanceName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("providerInstanceName") String providerInstanceName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @PathParam("providerInstanceName") String providerInstanceName, @BodyParam("application/json") ProviderInstanceInner providerInstanceParameter, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @PathParam("providerInstanceName") String providerInstanceName, - @HeaderParam("Accept") String accept, + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("providerInstanceName") String providerInstanceName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String monitorName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -174,35 +154,19 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -210,22 +174,18 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String monitorName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -237,31 +197,18 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -271,16 +218,16 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String monitorName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, monitorName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -291,24 +238,23 @@ private PagedFlux listAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String monitorName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, monitorName, context), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName) { @@ -317,18 +263,18 @@ public PagedIterable list(String resourceGroupName, Strin /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName, Context context) { @@ -337,10 +283,10 @@ public PagedIterable list(String resourceGroupName, Strin /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -348,22 +294,18 @@ public PagedIterable list(String resourceGroupName, Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response} on successful completion of {@link Mono}. + * resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName, String providerInstanceName) { + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -378,27 +320,17 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, providerInstanceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -407,22 +339,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response} on successful completion of {@link Mono}. + * resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -437,24 +365,16 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, providerInstanceName, accept, context); } /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -462,21 +382,21 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name on successful completion of {@link Mono}. + * resource name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String monitorName, String providerInstanceName) { + private Mono getAsync(String resourceGroupName, String monitorName, + String providerInstanceName) { return getWithResponseAsync(resourceGroupName, monitorName, providerInstanceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -485,20 +405,20 @@ private Mono getAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response}. + * resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + public Response getWithResponse(String resourceGroupName, String monitorName, + String providerInstanceName, Context context) { return getWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, context).block(); } /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -506,7 +426,7 @@ public Response getWithResponse( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name. + * resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) public ProviderInstanceInner get(String resourceGroupName, String monitorName, String providerInstanceName) { @@ -515,10 +435,9 @@ public ProviderInstanceInner get(String resourceGroupName, String monitorName, S /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -527,25 +446,18 @@ public ProviderInstanceInner get(String resourceGroupName, String monitorName, S * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter) { + private Mono>> createWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName, ProviderInstanceInner providerInstanceParameter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -559,37 +471,24 @@ private Mono>> createWithResponseAsync( .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); } if (providerInstanceParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter providerInstanceParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter providerInstanceParameter is required and cannot be null.")); } else { providerInstanceParameter.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, providerInstanceName, + providerInstanceParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -599,26 +498,18 @@ private Mono>> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, - Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName, ProviderInstanceInner providerInstanceParameter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -632,34 +523,22 @@ private Mono>> createWithResponseAsync( .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); } if (providerInstanceParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter providerInstanceParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter providerInstanceParameter is required and cannot be null.")); } else { providerInstanceParameter.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, accept, context); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -671,28 +550,20 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProviderInstanceInner> beginCreateAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, + String resourceGroupName, String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ProviderInstanceInner.class, - ProviderInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, + this.client.getContext()); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -705,27 +576,20 @@ private PollerFlux, ProviderInstanceInner> beg */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProviderInstanceInner> beginCreateAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, - Context context) { + String resourceGroupName, String monitorName, String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync( - resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, context); + Mono>> mono = createWithResponseAsync(resourceGroupName, monitorName, + providerInstanceName, providerInstanceParameter, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, context); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -736,22 +600,17 @@ private PollerFlux, ProviderInstanceInner> beg * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProviderInstanceInner> beginCreate( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter) { - return this - .beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter) + public SyncPoller, ProviderInstanceInner> beginCreate(String resourceGroupName, + String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter) { + return this.beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter) .getSyncPoller(); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -763,11 +622,8 @@ public SyncPoller, ProviderInstanceInner> begi * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProviderInstanceInner> beginCreate( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, + public SyncPoller, ProviderInstanceInner> beginCreate(String resourceGroupName, + String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter, Context context) { return this .beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) @@ -776,10 +632,9 @@ public SyncPoller, ProviderInstanceInner> begi /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -790,22 +645,17 @@ public SyncPoller, ProviderInstanceInner> begi * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter) { - return beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter) - .last() + private Mono createAsync(String resourceGroupName, String monitorName, + String providerInstanceName, ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -817,24 +667,17 @@ private Mono createAsync( * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, - Context context) { - return beginCreateAsync( - resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createAsync(String resourceGroupName, String monitorName, + String providerInstanceName, ProviderInstanceInner providerInstanceParameter, Context context) { + return beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -845,20 +688,16 @@ private Mono createAsync( * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInstanceInner create( - String resourceGroupName, - String monitorName, - String providerInstanceName, + public ProviderInstanceInner create(String resourceGroupName, String monitorName, String providerInstanceName, ProviderInstanceInner providerInstanceParameter) { return createAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter).block(); } /** * Creates a provider instance. - * - *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -870,45 +709,36 @@ public ProviderInstanceInner create( * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProviderInstanceInner create( - String resourceGroupName, - String monitorName, - String providerInstanceName, - ProviderInstanceInner providerInstanceParameter, - Context context) { + public ProviderInstanceInner create(String resourceGroupName, String monitorName, String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, Context context) { return createAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) .block(); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String monitorName, String providerInstanceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -923,27 +753,16 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, providerInstanceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -951,23 +770,19 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + String providerInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -982,24 +797,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - providerInstanceName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, providerInstanceName, accept, context); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1009,26 +815,20 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String monitorName, String providerInstanceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String monitorName, String providerInstanceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1039,27 +839,20 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String monitorName, String providerInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1069,17 +862,16 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, String providerInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String monitorName, String providerInstanceName) { return this.beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName).getSyncPoller(); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1090,17 +882,16 @@ public SyncPoller, OperationStatusResultI * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String monitorName, String providerInstanceName, Context context) { return this.beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName, context).getSyncPoller(); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1110,19 +901,17 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String monitorName, String providerInstanceName) { - return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName) - .last() + private Mono deleteAsync(String resourceGroupName, String monitorName, + String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1133,19 +922,17 @@ private Mono deleteAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String monitorName, + String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1155,17 +942,16 @@ private Mono deleteAsync( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String monitorName, String providerInstanceName) { + public OperationStatusResultInner delete(String resourceGroupName, String monitorName, + String providerInstanceName) { return deleteAsync(resourceGroupName, monitorName, providerInstanceName).block(); } /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -1176,21 +962,20 @@ public OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + public OperationStatusResultInner delete(String resourceGroupName, String monitorName, String providerInstanceName, + Context context) { return deleteAsync(resourceGroupName, monitorName, providerInstanceName, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List provider instances operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1198,37 +983,26 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List provider instances operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1236,23 +1010,13 @@ private Mono> listNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesImpl.java index 3024306681c9..1d28891b5cc5 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ProviderInstancesImpl.java @@ -23,31 +23,28 @@ public final class ProviderInstancesImpl implements ProviderInstances { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public ProviderInstancesImpl( - ProviderInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public ProviderInstancesImpl(ProviderInstancesClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceGroupName, String monitorName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName); - return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String monitorName, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName, context); - return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, monitorName, providerInstanceName, context); + public Response getWithResponse(String resourceGroupName, String monitorName, + String providerInstanceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, monitorName, providerInstanceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ProviderInstanceImpl(inner.getValue(), this.manager())); } else { return null; @@ -64,8 +61,8 @@ public ProviderInstance get(String resourceGroupName, String monitorName, String } public OperationStatusResult delete(String resourceGroupName, String monitorName, String providerInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName); + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -73,10 +70,10 @@ public OperationStatusResult delete(String resourceGroupName, String monitorName } } - public OperationStatusResult delete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName, context); + public OperationStatusResult delete(String resourceGroupName, String monitorName, String providerInstanceName, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -85,113 +82,77 @@ public OperationStatusResult delete( } public ProviderInstance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + String providerInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "providerInstances"); if (providerInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); } return this.getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + String providerInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "providerInstances"); if (providerInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); } return this.getWithResponse(resourceGroupName, monitorName, providerInstanceName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + String providerInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "providerInstances"); if (providerInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); } return this.delete(resourceGroupName, monitorName, providerInstanceName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String monitorName = Utils.getValueFromIdByName(id, "monitors"); + String monitorName = ResourceManagerUtils.getValueFromIdByName(id, "monitors"); if (monitorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); } - String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + String providerInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "providerInstances"); if (providerInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); } return this.delete(resourceGroupName, monitorName, providerInstanceName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/Utils.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/Utils.java rename to sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceManagerUtils.java index 10d30687e9a3..2a5a54181606 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/Utils.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersClientImpl.java index 5b9db6cd9157..583f4a5bfd40 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersClientImpl.java @@ -33,22 +33,28 @@ import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ResourceProvidersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of ResourceProvidersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ResourceProvidersClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,89 +65,69 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien @Host("{$host}") @ServiceInterface(name = "WorkloadsClientResou") public interface ResourceProvidersService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> sapSizingRecommendations( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, + Mono> sapSizingRecommendations(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapSizingRecommendationRequest sapSizingRecommendation, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> sapSupportedSku( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, + Mono> sapSupportedSku(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapSupportedSkusRequest sapSupportedSku, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> sapDiskConfigurations( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, + Mono> sapDiskConfigurations(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapDiskConfigurationsRequest sapDiskConfigurations, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> sapAvailabilityZoneDetails( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); } /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @param sapSizingRecommendation SAP Sizing Recommendation Request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier along with {@link Response} on successful completion of {@link Mono}. + * tier along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> sapSizingRecommendationsWithResponseAsync( String location, SapSizingRecommendationRequest sapSizingRecommendation) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -152,23 +138,15 @@ private Mono> sapSizingRecommendati final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .sapSizingRecommendations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapSizingRecommendation, - accept, - context)) + context -> service.sapSizingRecommendations(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), sapSizingRecommendation, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @param sapSizingRecommendation SAP Sizing Recommendation Request body. * @param context The context to associate with this operation. @@ -176,22 +154,18 @@ private Mono> sapSizingRecommendati * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier along with {@link Response} on successful completion of {@link Mono}. + * tier along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> sapSizingRecommendationsWithResponseAsync( String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -201,27 +175,20 @@ private Mono> sapSizingRecommendati } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .sapSizingRecommendations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapSizingRecommendation, - accept, - context); + return service.sapSizingRecommendations(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), sapSizingRecommendation, accept, context); } /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier on successful completion of {@link Mono}. + * tier on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono sapSizingRecommendationsAsync(String location) { @@ -233,7 +200,7 @@ private Mono sapSizingRecommendationsAsync(S /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @param sapSizingRecommendation SAP Sizing Recommendation Request body. * @param context The context to associate with this operation. @@ -241,24 +208,24 @@ private Mono sapSizingRecommendationsAsync(S * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier along with {@link Response}. + * tier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sapSizingRecommendationsWithResponse( - String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + public Response sapSizingRecommendationsWithResponse(String location, + SapSizingRecommendationRequest sapSizingRecommendation, Context context) { return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation, context).block(); } /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier. + * tier. */ @ServiceMethod(returns = ReturnType.SINGLE) public SapSizingRecommendationResultInner sapSizingRecommendations(String location) { @@ -268,29 +235,25 @@ public SapSizingRecommendationResultInner sapSizingRecommendations(String locati /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @param sapSupportedSku SAP Supported SKU Request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sapSupportedSkuWithResponseAsync( - String location, SapSupportedSkusRequest sapSupportedSku) { + private Mono> sapSupportedSkuWithResponseAsync(String location, + SapSupportedSkusRequest sapSupportedSku) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -300,23 +263,14 @@ private Mono> sapSupportedSkuWithR } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .sapSupportedSku( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapSupportedSku, - accept, - context)) + .withContext(context -> service.sapSupportedSku(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), sapSupportedSku, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @param sapSupportedSku SAP Supported SKU Request body. * @param context The context to associate with this operation. @@ -324,22 +278,18 @@ private Mono> sapSupportedSkuWithR * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sapSupportedSkuWithResponseAsync( - String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + private Mono> sapSupportedSkuWithResponseAsync(String location, + SapSupportedSkusRequest sapSupportedSku, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -349,26 +299,19 @@ private Mono> sapSupportedSkuWithR } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .sapSupportedSku( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapSupportedSku, - accept, - context); + return service.sapSupportedSku(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), sapSupportedSku, accept, context); } /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP supported SKUs for ASCS, Application and Database tier on successful completion of {@link - * Mono}. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono sapSupportedSkuAsync(String location) { @@ -379,7 +322,7 @@ private Mono sapSupportedSkuAsync(String lo /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @param sapSupportedSku SAP Supported SKU Request body. * @param context The context to associate with this operation. @@ -389,14 +332,14 @@ private Mono sapSupportedSkuAsync(String lo * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sapSupportedSkuWithResponse( - String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + public Response sapSupportedSkuWithResponse(String location, + SapSupportedSkusRequest sapSupportedSku, Context context) { return sapSupportedSkuWithResponseAsync(location, sapSupportedSku, context).block(); } /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -411,29 +354,25 @@ public SapSupportedResourceSkusResultInner sapSupportedSku(String location) { /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @param sapDiskConfigurations SAP Disk Configurations Request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sapDiskConfigurationsWithResponseAsync( - String location, SapDiskConfigurationsRequest sapDiskConfigurations) { + private Mono> sapDiskConfigurationsWithResponseAsync(String location, + SapDiskConfigurationsRequest sapDiskConfigurations) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -444,22 +383,14 @@ private Mono> sapDiskConfigurationsWi final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .sapDiskConfigurations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapDiskConfigurations, - accept, - context)) + context -> service.sapDiskConfigurations(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), sapDiskConfigurations, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @param sapDiskConfigurations SAP Disk Configurations Request body. * @param context The context to associate with this operation. @@ -467,22 +398,18 @@ private Mono> sapDiskConfigurationsWi * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sapDiskConfigurationsWithResponseAsync( - String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + private Mono> sapDiskConfigurationsWithResponseAsync(String location, + SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -492,20 +419,13 @@ private Mono> sapDiskConfigurationsWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .sapDiskConfigurations( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapDiskConfigurations, - accept, - context); + return service.sapDiskConfigurations(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), sapDiskConfigurations, accept, context); } /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -521,7 +441,7 @@ private Mono sapDiskConfigurationsAsync(String /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @param sapDiskConfigurations SAP Disk Configurations Request body. * @param context The context to associate with this operation. @@ -531,14 +451,14 @@ private Mono sapDiskConfigurationsAsync(String * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sapDiskConfigurationsWithResponse( - String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + public Response sapDiskConfigurationsWithResponse(String location, + SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations, context).block(); } /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -553,29 +473,25 @@ public SapDiskConfigurationsResultInner sapDiskConfigurations(String location) { /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> sapAvailabilityZoneDetailsWithResponseAsync( String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -585,23 +501,15 @@ private Mono> sapAvailabilityZon } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .sapAvailabilityZoneDetails( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapAvailabilityZoneDetails, - accept, - context)) + .withContext(context -> service.sapAvailabilityZoneDetails(this.client.getEndpoint(), + this.client.getSubscriptionId(), location, this.client.getApiVersion(), sapAvailabilityZoneDetails, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. * @param context The context to associate with this operation. @@ -609,22 +517,18 @@ private Mono> sapAvailabilityZon * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> sapAvailabilityZoneDetailsWithResponseAsync( String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -634,26 +538,19 @@ private Mono> sapAvailabilityZon } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .sapAvailabilityZoneDetails( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - sapAvailabilityZoneDetails, - accept, - context); + return service.sapAvailabilityZoneDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + this.client.getApiVersion(), sapAvailabilityZoneDetails, accept, context); } /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the recommended SAP Availability Zone Pair Details for your region on successful completion of {@link - * Mono}. + * @return the recommended SAP Availability Zone Pair Details for your region on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono sapAvailabilityZoneDetailsAsync(String location) { @@ -664,7 +561,7 @@ private Mono sapAvailabilityZoneDetailsAs /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. * @param context The context to associate with this operation. @@ -674,14 +571,14 @@ private Mono sapAvailabilityZoneDetailsAs * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sapAvailabilityZoneDetailsWithResponse( - String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + public Response sapAvailabilityZoneDetailsWithResponse(String location, + SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails, context).block(); } /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersImpl.java index e05b0d34100d..5e290c145e66 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersImpl.java @@ -30,21 +30,18 @@ public final class ResourceProvidersImpl implements ResourceProviders { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public ResourceProvidersImpl( - ResourceProvidersClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public ResourceProvidersImpl(ResourceProvidersClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response sapSizingRecommendationsWithResponse( - String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { - Response inner = - this.serviceClient().sapSizingRecommendationsWithResponse(location, sapSizingRecommendation, context); + public Response sapSizingRecommendationsWithResponse(String location, + SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + Response inner + = this.serviceClient().sapSizingRecommendationsWithResponse(location, sapSizingRecommendation, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapSizingRecommendationResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -60,15 +57,12 @@ public SapSizingRecommendationResult sapSizingRecommendations(String location) { } } - public Response sapSupportedSkuWithResponse( - String location, SapSupportedSkusRequest sapSupportedSku, Context context) { - Response inner = - this.serviceClient().sapSupportedSkuWithResponse(location, sapSupportedSku, context); + public Response sapSupportedSkuWithResponse(String location, + SapSupportedSkusRequest sapSupportedSku, Context context) { + Response inner + = this.serviceClient().sapSupportedSkuWithResponse(location, sapSupportedSku, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapSupportedResourceSkusResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -84,15 +78,12 @@ public SapSupportedResourceSkusResult sapSupportedSku(String location) { } } - public Response sapDiskConfigurationsWithResponse( - String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { - Response inner = - this.serviceClient().sapDiskConfigurationsWithResponse(location, sapDiskConfigurations, context); + public Response sapDiskConfigurationsWithResponse(String location, + SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + Response inner + = this.serviceClient().sapDiskConfigurationsWithResponse(location, sapDiskConfigurations, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapDiskConfigurationsResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -108,15 +99,12 @@ public SapDiskConfigurationsResult sapDiskConfigurations(String location) { } } - public Response sapAvailabilityZoneDetailsWithResponse( - String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { - Response inner = - this.serviceClient().sapAvailabilityZoneDetailsWithResponse(location, sapAvailabilityZoneDetails, context); + public Response sapAvailabilityZoneDetailsWithResponse(String location, + SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + Response inner = this.serviceClient() + .sapAvailabilityZoneDetailsWithResponse(location, sapAvailabilityZoneDetails, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapAvailabilityZoneDetailsResultImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstanceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstanceImpl.java index 54f3d4455c24..6d0f92a51a3b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstanceImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstanceImpl.java @@ -22,10 +22,8 @@ import java.util.List; import java.util.Map; -public final class SapApplicationServerInstanceImpl - implements SapApplicationServerInstance, - SapApplicationServerInstance.Definition, - SapApplicationServerInstance.Update { +public final class SapApplicationServerInstanceImpl implements SapApplicationServerInstance, + SapApplicationServerInstance.Definition, SapApplicationServerInstance.Update { private SapApplicationServerInstanceInner innerObject; private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; @@ -152,33 +150,25 @@ private com.azure.resourcemanager.workloads.WorkloadsManager manager() { private UpdateSapApplicationInstanceRequest updateBody; - public SapApplicationServerInstanceImpl withExistingSapVirtualInstance( - String resourceGroupName, String sapVirtualInstanceName) { + public SapApplicationServerInstanceImpl withExistingSapVirtualInstance(String resourceGroupName, + String sapVirtualInstanceName) { this.resourceGroupName = resourceGroupName; this.sapVirtualInstanceName = sapVirtualInstanceName; return this; } public SapApplicationServerInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .create( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.innerModel(), - Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .create(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.innerModel(), + Context.NONE); return this; } public SapApplicationServerInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .create(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .create(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.innerModel(), context); return this; } @@ -194,74 +184,63 @@ public SapApplicationServerInstanceImpl update() { } public SapApplicationServerInstance apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .update(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .update(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, Context.NONE); return this; } public SapApplicationServerInstance apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .update(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .update(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, context); return this; } - SapApplicationServerInstanceImpl( - SapApplicationServerInstanceInner innerObject, + SapApplicationServerInstanceImpl(SapApplicationServerInstanceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); - this.applicationInstanceName = Utils.getValueFromIdByName(innerObject.id(), "applicationInstances"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.applicationInstanceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applicationInstances"); } public SapApplicationServerInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + .getValue(); return this; } public SapApplicationServerInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapApplicationServerInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapApplicationServerInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .getValue(); return this; } public OperationStatusResult startInstance() { - return serviceManager - .sapApplicationServerInstances() + return serviceManager.sapApplicationServerInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); } public OperationStatusResult startInstance(Context context) { - return serviceManager - .sapApplicationServerInstances() + return serviceManager.sapApplicationServerInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); } public OperationStatusResult stopInstance() { - return serviceManager - .sapApplicationServerInstances() + return serviceManager.sapApplicationServerInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); } public OperationStatusResult stopInstance(StopRequest body, Context context) { - return serviceManager - .sapApplicationServerInstances() + return serviceManager.sapApplicationServerInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesClientImpl.java index 305024f04598..99c7f601c898 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesClientImpl.java @@ -43,26 +43,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. + */ public final class SapApplicationServerInstancesClientImpl implements SapApplicationServerInstancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SapApplicationServerInstancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of SapApplicationServerInstancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SapApplicationServerInstancesClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy - .create( - SapApplicationServerInstancesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(SapApplicationServerInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -73,127 +75,99 @@ public final class SapApplicationServerInstancesClientImpl implements SapApplica @Host("{$host}") @ServiceInterface(name = "WorkloadsClientSapAp") public interface SapApplicationServerInstancesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SapApplicationServerInstanceInner body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") SapApplicationServerInstanceInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") UpdateSapApplicationInstanceRequest body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startInstance( - @HostParam("$host") String endpoint, + Mono>> startInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stopInstance( - @HostParam("$host") String endpoint, + Mono>> stopInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("applicationInstanceName") String applicationInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopRequest body, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -201,57 +175,42 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -260,54 +219,40 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response} on successful completion of {@link Mono}. + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, context); } /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -315,18 +260,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono getAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -335,18 +280,18 @@ private Mono getAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response}. + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + public Response getWithResponse(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) .block(); } /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -356,8 +301,8 @@ public Response getWithResponse( * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapApplicationServerInstanceInner get( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SapApplicationServerInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { return getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) .getValue(); } @@ -365,7 +310,7 @@ public SapApplicationServerInstanceInner get( /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -374,65 +319,46 @@ public SapApplicationServerInstanceInner get( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, SapApplicationServerInstanceInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -442,63 +368,45 @@ private Mono>> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, SapApplicationServerInstanceInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -510,27 +418,19 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapApplicationServerInstanceInner> - beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, SapApplicationServerInstanceInner body) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, this.client.getContext()); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -543,22 +443,17 @@ private Mono>> createWithResponseAsync( private PollerFlux, SapApplicationServerInstanceInner> beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final SapApplicationServerInstanceInner body = null; - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, this.client.getContext()); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -571,29 +466,20 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapApplicationServerInstanceInner> - beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context) { + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + SapApplicationServerInstanceInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - context); + Mono>> mono = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, + applicationInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, context); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -603,18 +489,17 @@ private Mono>> createWithResponseAsync( * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapApplicationServerInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SyncPoller, SapApplicationServerInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final SapApplicationServerInstanceInner body = null; - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) .getSyncPoller(); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -627,20 +512,16 @@ public SyncPoller, SapApplicationS */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapApplicationServerInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context) { - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + SapApplicationServerInstanceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .getSyncPoller(); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -651,20 +532,16 @@ public SyncPoller, SapApplicationS * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, SapApplicationServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -674,18 +551,17 @@ private Mono createAsync( * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final SapApplicationServerInstanceInner body = null; - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -697,12 +573,8 @@ private Mono createAsync( * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context) { + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, SapApplicationServerInstanceInner body, Context context) { return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -711,7 +583,7 @@ private Mono createAsync( /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -721,8 +593,8 @@ private Mono createAsync( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapApplicationServerInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SapApplicationServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final SapApplicationServerInstanceInner body = null; return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); } @@ -730,7 +602,7 @@ public SapApplicationServerInstanceInner create( /** * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by * end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -742,18 +614,14 @@ public SapApplicationServerInstanceInner create( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapApplicationServerInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - SapApplicationServerInstanceInner body, - Context context) { + public SapApplicationServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, SapApplicationServerInstanceInner body, Context context) { return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context).block(); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -762,64 +630,45 @@ public SapApplicationServerInstanceInner create( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, UpdateSapApplicationInstanceRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -829,62 +678,44 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, UpdateSapApplicationInstanceRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -896,26 +727,18 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapApplicationServerInstanceInner> - beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, + beginUpdateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, UpdateSapApplicationInstanceRequest body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, this.client.getContext()); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -928,21 +751,16 @@ private Mono>> updateWithResponseAsync( private PollerFlux, SapApplicationServerInstanceInner> beginUpdateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final UpdateSapApplicationInstanceRequest body = null; - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, this.client.getContext()); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -955,28 +773,19 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapApplicationServerInstanceInner> - beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context) { + beginUpdateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapApplicationServerInstanceInner.class, - SapApplicationServerInstanceInner.class, - context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, + applicationInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, context); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -986,17 +795,16 @@ private Mono>> updateWithResponseAsync( * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapApplicationServerInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SyncPoller, SapApplicationServerInstanceInner> + beginUpdate(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final UpdateSapApplicationInstanceRequest body = null; - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) .getSyncPoller(); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1009,19 +817,15 @@ public SyncPoller, SapApplicationS */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapApplicationServerInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, Context context) { + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .getSyncPoller(); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1032,19 +836,15 @@ public SyncPoller, SapApplicationS * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body) { - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, UpdateSapApplicationInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1054,17 +854,16 @@ private Mono updateAsync( * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final UpdateSapApplicationInstanceRequest body = null; - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1076,12 +875,8 @@ private Mono updateAsync( * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context) { + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, UpdateSapApplicationInstanceRequest body, Context context) { return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1089,7 +884,7 @@ private Mono updateAsync( /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1099,15 +894,15 @@ private Mono updateAsync( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapApplicationServerInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SapApplicationServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final UpdateSapApplicationInstanceRequest body = null; return updateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); } /** * Puts the SAP Application Server Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1119,78 +914,59 @@ public SapApplicationServerInstanceInner update( * @return define the SAP Application Server Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapApplicationServerInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - UpdateSapApplicationInstanceRequest body, - Context context) { + public SapApplicationServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, UpdateSapApplicationInstanceRequest body, Context context) { return updateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context).block(); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1198,56 +974,42 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, context); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1257,24 +1019,19 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1288,22 +1045,16 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginDeleteAsync( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1313,17 +1064,16 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - return this - .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) .getSyncPoller(); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1336,15 +1086,14 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginDelete( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) .getSyncPoller(); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1354,17 +1103,16 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1375,17 +1123,16 @@ private Mono deleteAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1395,15 +1142,15 @@ private Mono deleteAsync( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).block(); } /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1414,74 +1161,53 @@ public OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context).block(); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1489,189 +1215,154 @@ private Mono> listSinglePageAsy * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, sapVirtualInstanceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedFlux}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String sapVirtualInstanceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + private PagedFlux listAsync(String resourceGroupName, + String sapVirtualInstanceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedFlux}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + private PagedFlux listAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName) { + public PagedIterable list(String resourceGroupName, + String sapVirtualInstanceName) { return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); } /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public PagedIterable list(String resourceGroupName, + String sapVirtualInstanceName, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1679,55 +1370,41 @@ private Mono>> startInstanceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), accept, context); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1739,21 +1416,16 @@ private Mono>> startInstanceWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1767,21 +1439,15 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono = startInstanceWithResponseAsync(resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1791,16 +1457,15 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) + public SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) .getSyncPoller(); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1813,14 +1478,13 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStartInstance( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) .getSyncPoller(); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1830,16 +1494,15 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) - .last() + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1850,8 +1513,8 @@ private Mono startInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -1859,7 +1522,7 @@ private Mono startInstanceAsync( /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1869,14 +1532,14 @@ private Mono startInstanceAsync( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).block(); } /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1887,14 +1550,14 @@ public OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context).block(); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1902,62 +1565,46 @@ public OperationStatusResultInner startInstance( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -1966,63 +1613,44 @@ private Mono>> stopInstanceWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, StopRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (applicationInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, applicationInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2035,21 +1663,16 @@ private Mono>> stopInstanceWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2062,21 +1685,16 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final StopRequest body = null; - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2089,28 +1707,18 @@ private PollerFlux, OperationStatusResult */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - stopInstanceWithResponseAsync( - resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, + applicationInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2120,17 +1728,16 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { final StopRequest body = null; - return this - .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + return this.beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) .getSyncPoller(); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2143,10 +1750,7 @@ public SyncPoller, OperationStatusResultI */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body, Context context) { return this .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) @@ -2155,7 +1759,7 @@ public SyncPoller, OperationStatusResultI /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2166,16 +1770,15 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2185,17 +1788,16 @@ private Mono stopInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final StopRequest body = null; - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) - .last() + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2207,12 +1809,8 @@ private Mono stopInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body, Context context) { return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -2220,7 +1818,7 @@ private Mono stopInstanceAsync( /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2230,15 +1828,15 @@ private Mono stopInstanceAsync( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { final StopRequest body = null; return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); } /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -2250,26 +1848,21 @@ public OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body, Context context) { return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) .block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2277,62 +1870,41 @@ private Mono> listNextSinglePag return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesImpl.java index 53a4fe12a6c2..fb4cd2ea20c3 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesImpl.java @@ -24,34 +24,28 @@ public final class SapApplicationServerInstancesImpl implements SapApplicationSe private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public SapApplicationServerInstancesImpl( - SapApplicationServerInstancesClient innerClient, + public SapApplicationServerInstancesImpl(SapApplicationServerInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + public Response getWithResponse(String resourceGroupName, + String sapVirtualInstanceName, String applicationInstanceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapApplicationServerInstanceImpl(inner.getValue(), this.manager())); } else { return null; } } - public SapApplicationServerInstance get( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - SapApplicationServerInstanceInner inner = - this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + public SapApplicationServerInstance get(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + SapApplicationServerInstanceInner inner + = this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); if (inner != null) { return new SapApplicationServerInstanceImpl(inner, this.manager()); } else { @@ -59,10 +53,10 @@ public SapApplicationServerInstance get( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -70,10 +64,10 @@ public OperationStatusResult delete( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -82,22 +76,24 @@ public OperationStatusResult delete( } public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); - return Utils.mapPage(inner, inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); - return Utils.mapPage(inner, inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -105,12 +101,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { - OperationStatusResultInner inner = - this - .serviceClient() - .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -118,10 +112,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -129,16 +123,10 @@ public OperationStatusResult stopInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context) { - OperationStatusResultInner inner = - this - .serviceClient() - .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -147,127 +135,78 @@ public OperationStatusResult stopInstance( } public SapApplicationServerInstance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + String applicationInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "applicationInstances"); if (applicationInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", id))); } - return this - .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + String applicationInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "applicationInstances"); if (applicationInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", id))); } return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + String applicationInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "applicationInstances"); if (applicationInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + String applicationInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "applicationInstances"); if (applicationInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapAvailabilityZoneDetailsResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapAvailabilityZoneDetailsResultImpl.java index 1eac80588ea3..9d6d201cd6d6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapAvailabilityZoneDetailsResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapAvailabilityZoneDetailsResultImpl.java @@ -15,8 +15,7 @@ public final class SapAvailabilityZoneDetailsResultImpl implements SapAvailabili private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapAvailabilityZoneDetailsResultImpl( - SapAvailabilityZoneDetailsResultInner innerObject, + SapAvailabilityZoneDetailsResultImpl(SapAvailabilityZoneDetailsResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesClientImpl.java index a802b4202aae..ef167e2efd90 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesClientImpl.java @@ -43,22 +43,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapCentralInstancesClient. + */ public final class SapCentralInstancesClientImpl implements SapCentralInstancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SapCentralInstancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of SapCentralInstancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SapCentralInstancesClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy.create(SapCentralInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SapCentralInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -69,160 +75,123 @@ public final class SapCentralInstancesClientImpl implements SapCentralInstancesC @Host("{$host}") @ServiceInterface(name = "WorkloadsClientSapCe") public interface SapCentralInstancesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SapCentralServerInstanceInner body, - @HeaderParam("Accept") String accept, + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapCentralServerInstanceInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSapCentralInstanceRequest body, - @HeaderParam("Accept") String accept, + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSapCentralInstanceRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startInstance( - @HostParam("$host") String endpoint, + Mono>> startInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stopInstance( - @HostParam("$host") String endpoint, + Mono>> stopInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @PathParam("centralInstanceName") String centralInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopRequest body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("centralInstanceName") String centralInstanceName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -231,57 +200,43 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -289,44 +244,36 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, context); } /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono getAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -334,70 +281,62 @@ private Mono getAsync( * @return the SAP Central Services Instance resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + public Response getWithResponse(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, Context context) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); } /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapCentralServerInstanceInner get( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SapCentralServerInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { return getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE).getValue(); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, SapCentralServerInstanceInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -409,64 +348,46 @@ private Mono>> createWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, SapCentralServerInstanceInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -477,27 +398,18 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -506,59 +418,47 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, SapCentralServerInstanceInner body) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + this.client.getContext()); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private PollerFlux, SapCentralServerInstanceInner> + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final SapCentralServerInstanceInner body = null; - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + this.client.getContext()); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -568,54 +468,45 @@ private PollerFlux, SapCentralServerIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context) { + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + SapCentralServerInstanceInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + context); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapCentralServerInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SyncPoller, SapCentralServerInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final SapCentralServerInstanceInner body = null; - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) .getSyncPoller(); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -625,24 +516,20 @@ public SyncPoller, SapCentralServerIns */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapCentralServerInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context) { - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + SapCentralServerInstanceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) .getSyncPoller(); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -650,46 +537,41 @@ public SyncPoller, SapCentralServerIns * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, SapCentralServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final SapCentralServerInstanceInner body = null; - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -698,33 +580,28 @@ private Mono createAsync( * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, SapCentralServerInstanceInner body, Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapCentralServerInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SapCentralServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final SapCentralServerInstanceInner body = null; return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); } @@ -732,11 +609,11 @@ public SapCentralServerInstanceInner create( /** * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT * operation on this resource by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -745,56 +622,44 @@ public SapCentralServerInstanceInner create( * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapCentralServerInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - SapCentralServerInstanceInner body, - Context context) { + public SapCentralServerInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, SapCentralServerInstanceInner body, Context context) { return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, UpdateSapCentralInstanceRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -806,64 +671,46 @@ private Mono>> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, UpdateSapCentralInstanceRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -874,27 +721,18 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -903,59 +741,47 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapCentralServerInstanceInner> beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, UpdateSapCentralInstanceRequest body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + this.client.getContext()); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapCentralServerInstanceInner> beginUpdateAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private PollerFlux, SapCentralServerInstanceInner> + beginUpdateAsync(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final UpdateSapCentralInstanceRequest body = null; - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + this.client.getContext()); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -965,54 +791,45 @@ private PollerFlux, SapCentralServerIn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapCentralServerInstanceInner> beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context) { + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + UpdateSapCentralInstanceRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapCentralServerInstanceInner.class, - SapCentralServerInstanceInner.class, - context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapCentralServerInstanceInner.class, SapCentralServerInstanceInner.class, + context); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapCentralServerInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SyncPoller, SapCentralServerInstanceInner> + beginUpdate(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final UpdateSapCentralInstanceRequest body = null; - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) .getSyncPoller(); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1022,24 +839,20 @@ public SyncPoller, SapCentralServerIns */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapCentralServerInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + UpdateSapCentralInstanceRequest body, Context context) { + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) .getSyncPoller(); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1047,46 +860,41 @@ public SyncPoller, SapCentralServerIns * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body) { - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, UpdateSapCentralInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final UpdateSapCentralInstanceRequest body = null; - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1095,33 +903,28 @@ private Mono updateAsync( * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context) { - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, UpdateSapCentralInstanceRequest body, Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapCentralServerInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SapCentralServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final UpdateSapCentralInstanceRequest body = null; return updateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); } @@ -1129,11 +932,11 @@ public SapCentralServerInstanceInner update( /** * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the * resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body The SAP Central Services Instance resource request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1142,12 +945,8 @@ public SapCentralServerInstanceInner update( * @return define the SAP Central Services Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapCentralServerInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - UpdateSapCentralInstanceRequest body, - Context context) { + public SapCentralServerInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, UpdateSapCentralInstanceRequest body, Context context) { return updateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); } @@ -1155,40 +954,35 @@ public SapCentralServerInstanceInner update( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -1197,17 +991,8 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1215,41 +1000,36 @@ private Mono>> deleteWithResponseAsync( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -1257,56 +1037,43 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, context); } /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1317,35 +1084,29 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginDeleteAsync( String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).getSyncPoller(); } @@ -1353,11 +1114,11 @@ public SyncPoller, OperationStatusResultI * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1367,8 +1128,7 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginDelete( String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) .getSyncPoller(); } @@ -1376,21 +1136,20 @@ public SyncPoller, OperationStatusResultI * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1398,11 +1157,11 @@ private Mono deleteAsync( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1410,10 +1169,9 @@ private Mono deleteAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1421,19 +1179,19 @@ private Mono deleteAsync( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).block(); } @@ -1441,11 +1199,11 @@ public OperationStatusResultInner delete( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1453,74 +1211,53 @@ public OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); } /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1528,103 +1265,83 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, sapVirtualInstanceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedFlux}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String sapVirtualInstanceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + private PagedFlux listAsync(String resourceGroupName, + String sapVirtualInstanceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedFlux}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + private PagedFlux listAsync(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { @@ -1633,58 +1350,53 @@ public PagedIterable list(String resourceGroupNam /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -1692,58 +1404,44 @@ private Mono>> startInstanceWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -1751,52 +1449,39 @@ private Mono>> startInstanceWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), accept, context); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginStartInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + Mono>> mono + = startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1807,45 +1492,38 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) + public SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) .getSyncPoller(); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1855,38 +1533,36 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStartInstance( String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) .getSyncPoller(); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) - .last() + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1894,38 +1570,37 @@ private Mono startInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) - .last() + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).block(); } /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1933,48 +1608,43 @@ public OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -1985,64 +1655,45 @@ private Mono>> stopInstanceWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String centralInstanceName, StopRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (centralInstanceName == null) { return Mono @@ -2053,26 +1704,17 @@ private Mono>> stopInstanceWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, centralInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2082,53 +1724,43 @@ private Mono>> stopInstanceWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private PollerFlux, OperationStatusResultInner> + beginStopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final StopRequest body = null; - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2138,53 +1770,42 @@ private PollerFlux, OperationStatusResult */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - stopInstanceWithResponseAsync( - resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, + centralInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { final StopRequest body = null; - return this - .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + return this.beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) .getSyncPoller(); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2194,10 +1815,7 @@ public SyncPoller, OperationStatusResultI */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body, Context context) { return this .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) @@ -2206,11 +1824,11 @@ public SyncPoller, OperationStatusResultI /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2218,41 +1836,39 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final StopRequest body = null; - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) - .last() + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2261,12 +1877,8 @@ private Mono stopInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body, Context context) { return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -2274,30 +1886,30 @@ private Mono stopInstanceAsync( /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { final StopRequest body = null; return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); } /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2306,25 +1918,20 @@ public OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body, Context context) { return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2332,62 +1939,41 @@ private Mono> listNextSinglePageAsy return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesImpl.java index 16e7931212f5..99d3ff4c1ab5 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesImpl.java @@ -24,33 +24,28 @@ public final class SapCentralInstancesImpl implements SapCentralInstances { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public SapCentralInstancesImpl( - SapCentralInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public SapCentralInstancesImpl(SapCentralInstancesClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + public Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapCentralServerInstanceImpl(inner.getValue(), this.manager())); } else { return null; } } - public SapCentralServerInstance get( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - SapCentralServerInstanceInner inner = - this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + public SapCentralServerInstance get(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + SapCentralServerInstanceInner inner + = this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, centralInstanceName); if (inner != null) { return new SapCentralServerInstanceImpl(inner, this.manager()); } else { @@ -58,10 +53,10 @@ public SapCentralServerInstance get( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -69,10 +64,10 @@ public OperationStatusResult delete( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -81,22 +76,22 @@ public OperationStatusResult delete( } public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); - return Utils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); - return Utils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -104,10 +99,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -115,10 +110,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -126,16 +121,10 @@ public OperationStatusResult stopInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context) { - OperationStatusResultInner inner = - this - .serviceClient() - .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -144,123 +133,78 @@ public OperationStatusResult stopInstance( } public SapCentralServerInstance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + String centralInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "centralInstances"); if (centralInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); } - return this - .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + String centralInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "centralInstances"); if (centralInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); } return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + String centralInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "centralInstances"); if (centralInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + String centralInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "centralInstances"); if (centralInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralServerInstanceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralServerInstanceImpl.java index 0d1e8721f30e..bad6da418750 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralServerInstanceImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralServerInstanceImpl.java @@ -150,29 +150,24 @@ private com.azure.resourcemanager.workloads.WorkloadsManager manager() { private UpdateSapCentralInstanceRequest updateBody; - public SapCentralServerInstanceImpl withExistingSapVirtualInstance( - String resourceGroupName, String sapVirtualInstanceName) { + public SapCentralServerInstanceImpl withExistingSapVirtualInstance(String resourceGroupName, + String sapVirtualInstanceName) { this.resourceGroupName = resourceGroupName; this.sapVirtualInstanceName = sapVirtualInstanceName; return this; } public SapCentralServerInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .create( - resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .create(resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), Context.NONE); return this; } public SapCentralServerInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .create(resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .create(resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), context); return this; } @@ -188,74 +183,62 @@ public SapCentralServerInstanceImpl update() { } public SapCentralServerInstance apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .update(resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .update(resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, Context.NONE); return this; } public SapCentralServerInstance apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .update(resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .update(resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, context); return this; } - SapCentralServerInstanceImpl( - SapCentralServerInstanceInner innerObject, + SapCentralServerInstanceImpl(SapCentralServerInstanceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); - this.centralInstanceName = Utils.getValueFromIdByName(innerObject.id(), "centralInstances"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.centralInstanceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "centralInstances"); } public SapCentralServerInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) + .getValue(); return this; } public SapCentralServerInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapCentralInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapCentralInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + .getValue(); return this; } public OperationStatusResult startInstance() { - return serviceManager - .sapCentralInstances() + return serviceManager.sapCentralInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); } public OperationStatusResult startInstance(Context context) { - return serviceManager - .sapCentralInstances() + return serviceManager.sapCentralInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); } public OperationStatusResult stopInstance() { - return serviceManager - .sapCentralInstances() + return serviceManager.sapCentralInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); } public OperationStatusResult stopInstance(StopRequest body, Context context) { - return serviceManager - .sapCentralInstances() + return serviceManager.sapCentralInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); } @@ -294,8 +277,8 @@ public SapCentralServerInstanceImpl withGatewayServerProperties(GatewayServerPro return this; } - public SapCentralServerInstanceImpl withEnqueueReplicationServerProperties( - EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + public SapCentralServerInstanceImpl + withEnqueueReplicationServerProperties(EnqueueReplicationServerProperties enqueueReplicationServerProperties) { this.innerModel().withEnqueueReplicationServerProperties(enqueueReplicationServerProperties); return this; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstanceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstanceImpl.java index 915f1132476e..9d7efdf42ebd 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstanceImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstanceImpl.java @@ -125,29 +125,24 @@ private com.azure.resourcemanager.workloads.WorkloadsManager manager() { private UpdateSapDatabaseInstanceRequest updateBody; - public SapDatabaseInstanceImpl withExistingSapVirtualInstance( - String resourceGroupName, String sapVirtualInstanceName) { + public SapDatabaseInstanceImpl withExistingSapVirtualInstance(String resourceGroupName, + String sapVirtualInstanceName) { this.resourceGroupName = resourceGroupName; this.sapVirtualInstanceName = sapVirtualInstanceName; return this; } public SapDatabaseInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .create( - resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .create(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), Context.NONE); return this; } public SapDatabaseInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .create(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .create(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), context); return this; } @@ -163,73 +158,62 @@ public SapDatabaseInstanceImpl update() { } public SapDatabaseInstance apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .update(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .update(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, Context.NONE); return this; } public SapDatabaseInstance apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .update(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, context); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .update(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, context); return this; } - SapDatabaseInstanceImpl( - SapDatabaseInstanceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + SapDatabaseInstanceImpl(SapDatabaseInstanceInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); - this.databaseInstanceName = Utils.getValueFromIdByName(innerObject.id(), "databaseInstances"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.databaseInstanceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "databaseInstances"); } public SapDatabaseInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + .getValue(); return this; } public SapDatabaseInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapDatabaseInstances() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapDatabaseInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + .getValue(); return this; } public OperationStatusResult startInstance() { - return serviceManager - .sapDatabaseInstances() + return serviceManager.sapDatabaseInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); } public OperationStatusResult startInstance(Context context) { - return serviceManager - .sapDatabaseInstances() + return serviceManager.sapDatabaseInstances() .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); } public OperationStatusResult stopInstance() { - return serviceManager - .sapDatabaseInstances() + return serviceManager.sapDatabaseInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); } public OperationStatusResult stopInstance(StopRequest body, Context context) { - return serviceManager - .sapDatabaseInstances() + return serviceManager.sapDatabaseInstances() .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesClientImpl.java index 5cf1b76d9ea1..6fc0392a86f6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesClientImpl.java @@ -43,23 +43,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. + */ public final class SapDatabaseInstancesClientImpl implements SapDatabaseInstancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SapDatabaseInstancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of SapDatabaseInstancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SapDatabaseInstancesClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy - .create(SapDatabaseInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SapDatabaseInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -70,159 +75,124 @@ public final class SapDatabaseInstancesClientImpl implements SapDatabaseInstance @Host("{$host}") @ServiceInterface(name = "WorkloadsClientSapDa") public interface SapDatabaseInstancesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SapDatabaseInstanceInner body, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapDatabaseInstanceInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSapDatabaseInstanceRequest body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSapDatabaseInstanceRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> startInstance( - @HostParam("$host") String endpoint, + Mono>> startInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stopInstance( - @HostParam("$host") String endpoint, + Mono>> stopInstance(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @PathParam("databaseInstanceName") String databaseInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopRequest body, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Database Instance resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -231,27 +201,18 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -259,28 +220,23 @@ private Mono> getWithResponseAsync( * @return the SAP Database Instance resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -288,44 +244,36 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, context); } /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Database Instance resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono getAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -333,26 +281,26 @@ private Mono getAsync( * @return the SAP Database Instance resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + public Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); } /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Database Instance resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapDatabaseInstanceInner get( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SapDatabaseInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { return getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) .getValue(); } @@ -360,11 +308,11 @@ public SapDatabaseInstanceInner get( /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -372,31 +320,23 @@ public SapDatabaseInstanceInner get( * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, SapDatabaseInstanceInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -408,29 +348,19 @@ private Mono>> createWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -439,32 +369,23 @@ private Mono>> createWithResponseAsync( * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, SapDatabaseInstanceInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -475,27 +396,18 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -504,59 +416,47 @@ private Mono>> createWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, SapDatabaseInstanceInner body) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, + this.client.getContext()); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private PollerFlux, SapDatabaseInstanceInner> + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final SapDatabaseInstanceInner body = null; - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, + this.client.getContext()); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -566,54 +466,44 @@ private PollerFlux, SapDatabaseInstanceInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context) { + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, + SapDatabaseInstanceInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, context); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapDatabaseInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SyncPoller, SapDatabaseInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final SapDatabaseInstanceInner body = null; - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) .getSyncPoller(); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -623,24 +513,20 @@ public SyncPoller, SapDatabaseInstanceInner */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapDatabaseInstanceInner> beginCreate( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context) { - return this - .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, + SapDatabaseInstanceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) .getSyncPoller(); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -648,46 +534,41 @@ public SyncPoller, SapDatabaseInstanceInner * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, SapDatabaseInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final SapDatabaseInstanceInner body = null; - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -696,33 +577,28 @@ private Mono createAsync( * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, SapDatabaseInstanceInner body, Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapDatabaseInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SapDatabaseInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final SapDatabaseInstanceInner body = null; return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); } @@ -730,11 +606,11 @@ public SapDatabaseInstanceInner create( /** * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Request body of Database resource of a SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -743,22 +619,18 @@ public SapDatabaseInstanceInner create( * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapDatabaseInstanceInner create( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - SapDatabaseInstanceInner body, - Context context) { + public SapDatabaseInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, SapDatabaseInstanceInner body, Context context) { return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).block(); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -766,31 +638,23 @@ public SapDatabaseInstanceInner create( * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, UpdateSapDatabaseInstanceRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -802,28 +666,18 @@ private Mono>> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -832,32 +686,24 @@ private Mono>> updateWithResponseAsync( * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, UpdateSapDatabaseInstanceRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -868,26 +714,17 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -896,57 +733,45 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapDatabaseInstanceInner> beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, UpdateSapDatabaseInstanceRequest body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, + this.client.getContext()); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapDatabaseInstanceInner> beginUpdateAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private PollerFlux, SapDatabaseInstanceInner> + beginUpdateAsync(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final UpdateSapDatabaseInstanceRequest body = null; - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, + this.client.getContext()); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -956,52 +781,42 @@ private PollerFlux, SapDatabaseInstanceInne */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SapDatabaseInstanceInner> beginUpdateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, - Context context) { + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapDatabaseInstanceInner.class, - SapDatabaseInstanceInner.class, - context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapDatabaseInstanceInner.class, SapDatabaseInstanceInner.class, context); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of define the Database resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapDatabaseInstanceInner> beginUpdate( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SyncPoller, SapDatabaseInstanceInner> + beginUpdate(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final UpdateSapDatabaseInstanceRequest body = null; - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) .getSyncPoller(); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1011,23 +826,19 @@ public SyncPoller, SapDatabaseInstanceInner */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SapDatabaseInstanceInner> beginUpdate( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, Context context) { + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) .getSyncPoller(); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1035,44 +846,39 @@ public SyncPoller, SapDatabaseInstanceInner * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body) { - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, UpdateSapDatabaseInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final UpdateSapDatabaseInstanceRequest body = null; - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1081,43 +887,38 @@ private Mono updateAsync( * @return define the Database resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, - Context context) { - return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, UpdateSapDatabaseInstanceRequest body, Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapDatabaseInstanceInner update( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SapDatabaseInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final UpdateSapDatabaseInstanceRequest body = null; return updateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); } /** * Updates the Database resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Database resource update request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1126,52 +927,43 @@ public SapDatabaseInstanceInner update( * @return define the Database resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapDatabaseInstanceInner update( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - UpdateSapDatabaseInstanceRequest body, - Context context) { + public SapDatabaseInstanceInner update(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, UpdateSapDatabaseInstanceRequest body, Context context) { return updateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).block(); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -1180,58 +972,44 @@ private Mono>> deleteWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -1239,54 +1017,41 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, context); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1297,45 +1062,39 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginDeleteAsync( String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).getSyncPoller(); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1345,40 +1104,38 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginDelete( String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) .getSyncPoller(); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1386,40 +1143,39 @@ private Mono deleteAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).block(); } /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1427,74 +1183,53 @@ public OperationStatusResultInner delete( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + public OperationStatusResultInner delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { return deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); } /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1502,57 +1237,39 @@ private Mono> listSinglePageAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, sapVirtualInstanceName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1562,14 +1279,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String sapVirtualInstanceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1579,16 +1295,15 @@ private PagedFlux listAsync(String resourceGroupName, * @return defines the collection of SAP Database Instances as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + private PagedFlux listAsync(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1603,7 +1318,7 @@ public PagedIterable list(String resourceGroupName, St /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1613,47 +1328,42 @@ public PagedIterable list(String resourceGroupName, St * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context) { return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -1661,58 +1371,44 @@ private Mono>> startInstanceWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + private Mono>> startInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -1720,52 +1416,39 @@ private Mono>> startInstanceWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .startInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.startInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), accept, context); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + private PollerFlux, OperationStatusResultInner> + beginStartInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + Mono>> mono + = startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1776,45 +1459,38 @@ private PollerFlux, OperationStatusResult private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStartInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) + public SyncPoller, OperationStatusResultInner> + beginStartInstance(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) .getSyncPoller(); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1824,38 +1500,36 @@ public SyncPoller, OperationStatusResultI @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStartInstance( String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - return this - .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + return this.beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) .getSyncPoller(); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) - .last() + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1863,38 +1537,37 @@ private Mono startInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) - .last() + private Mono startInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).block(); } /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1902,48 +1575,43 @@ public OperationStatusResultInner startInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + public OperationStatusResultInner startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -1954,64 +1622,45 @@ private Mono>> stopInstanceWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopInstanceWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context) { + private Mono>> stopInstanceWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, String databaseInstanceName, StopRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (databaseInstanceName == null) { return Mono @@ -2022,26 +1671,17 @@ private Mono>> stopInstanceWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .stopInstance( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.stopInstance(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, databaseInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2051,53 +1691,43 @@ private Mono>> stopInstanceWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private PollerFlux, OperationStatusResultInner> + beginStopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final StopRequest body = null; - Mono>> mono = - stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + Mono>> mono + = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2107,53 +1737,42 @@ private PollerFlux, OperationStatusResult */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - stopInstanceWithResponseAsync( - resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono = stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, + databaseInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginStopInstance(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { final StopRequest body = null; - return this - .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + return this.beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) .getSyncPoller(); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2163,10 +1782,7 @@ public SyncPoller, OperationStatusResultI */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OperationStatusResultInner> beginStopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body, Context context) { return this .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) @@ -2175,11 +1791,11 @@ public SyncPoller, OperationStatusResultI /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2187,41 +1803,39 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final StopRequest body = null; - return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) - .last() + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2230,12 +1844,8 @@ private Mono stopInstanceAsync( * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopInstanceAsync( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context) { + private Mono stopInstanceAsync(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body, Context context) { return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -2243,30 +1853,30 @@ private Mono stopInstanceAsync( /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { final StopRequest body = null; return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); } /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2275,26 +1885,21 @@ public OperationStatusResultInner stopInstance( * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context) { + public OperationStatusResultInner stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body, Context context) { return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) .block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2302,37 +1907,26 @@ private Mono> listNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2340,23 +1934,13 @@ private Mono> listNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesImpl.java index c5e0a04bff98..53be7ed95dfb 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesImpl.java @@ -24,33 +24,28 @@ public final class SapDatabaseInstancesImpl implements SapDatabaseInstances { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public SapDatabaseInstancesImpl( - SapDatabaseInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public SapDatabaseInstancesImpl(SapDatabaseInstancesClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + public Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapDatabaseInstanceImpl(inner.getValue(), this.manager())); } else { return null; } } - public SapDatabaseInstance get( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - SapDatabaseInstanceInner inner = - this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + public SapDatabaseInstance get(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + SapDatabaseInstanceInner inner + = this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); if (inner != null) { return new SapDatabaseInstanceImpl(inner, this.manager()); } else { @@ -58,10 +53,10 @@ public SapDatabaseInstance get( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -69,10 +64,10 @@ public OperationStatusResult delete( } } - public OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -81,22 +76,22 @@ public OperationStatusResult delete( } public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); - return Utils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); - return Utils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -104,12 +99,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { - OperationStatusResultInner inner = - this - .serviceClient() - .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + public OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -117,10 +110,10 @@ public OperationStatusResult startInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { - OperationStatusResultInner inner = - this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName) { + OperationStatusResultInner inner + = this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -128,16 +121,10 @@ public OperationStatusResult stopInstance( } } - public OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context) { - OperationStatusResultInner inner = - this - .serviceClient() - .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + public OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body, Context context) { + OperationStatusResultInner inner = this.serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -146,123 +133,78 @@ public OperationStatusResult stopInstance( } public SapDatabaseInstance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + String databaseInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseInstances"); if (databaseInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); } - return this - .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + String databaseInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseInstances"); if (databaseInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); } return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + String databaseInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseInstances"); if (databaseInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } - String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + String databaseInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseInstances"); if (databaseInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDiskConfigurationsResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDiskConfigurationsResultImpl.java index 884dca8e351b..f0789e264f9e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDiskConfigurationsResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDiskConfigurationsResultImpl.java @@ -15,8 +15,7 @@ public final class SapDiskConfigurationsResultImpl implements SapDiskConfigurati private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapDiskConfigurationsResultImpl( - SapDiskConfigurationsResultInner innerObject, + SapDiskConfigurationsResultImpl(SapDiskConfigurationsResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorImpl.java index 57700d26ec0e..2727c558b0b5 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorImpl.java @@ -18,8 +18,8 @@ public final class SapLandscapeMonitorImpl implements SapLandscapeMonitor { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapLandscapeMonitorImpl( - SapLandscapeMonitorInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + SapLandscapeMonitorImpl(SapLandscapeMonitorInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorListResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorListResultImpl.java index 1323633a206a..d1972e946533 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorListResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorListResultImpl.java @@ -17,8 +17,7 @@ public final class SapLandscapeMonitorListResultImpl implements SapLandscapeMoni private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapLandscapeMonitorListResultImpl( - SapLandscapeMonitorListResultInner innerObject, + SapLandscapeMonitorListResultImpl(SapLandscapeMonitorListResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,9 @@ public final class SapLandscapeMonitorListResultImpl implements SapLandscapeMoni public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SapLandscapeMonitorImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new SapLandscapeMonitorImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsClientImpl.java index ff901703af6f..abb2bfbcba5c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsClientImpl.java @@ -30,23 +30,28 @@ import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. */ +/** + * An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. + */ public final class SapLandscapeMonitorsClientImpl implements SapLandscapeMonitorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SapLandscapeMonitorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of SapLandscapeMonitorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SapLandscapeMonitorsClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy - .create(SapLandscapeMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SapLandscapeMonitorsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,107 +62,78 @@ public final class SapLandscapeMonitorsClientImpl implements SapLandscapeMonitor @Host("{$host}") @ServiceInterface(name = "WorkloadsClientSapLa") public interface SapLandscapeMonitorsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @BodyParam("application/json") SapLandscapeMonitorInner sapLandscapeMonitorParameter, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @BodyParam("application/json") SapLandscapeMonitorInner sapLandscapeMonitorParameter, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("monitorName") String monitorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -168,26 +144,17 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -195,22 +162,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -221,30 +184,23 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name on successful completion of {@link Mono}. + * group, and resource name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String monitorName) { @@ -253,10 +209,10 @@ private Mono getAsync(String resourceGroupName, String /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -264,27 +220,27 @@ private Mono getAsync(String resourceGroupName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response getWithResponse(String resourceGroupName, String monitorName, + Context context) { return getWithResponseAsync(resourceGroupName, monitorName, context).block(); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) public SapLandscapeMonitorInner get(String resourceGroupName, String monitorName) { @@ -293,33 +249,29 @@ public SapLandscapeMonitorInner get(String resourceGroupName, String monitorName /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + private Mono> createWithResponseAsync(String resourceGroupName, + String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -329,63 +281,45 @@ private Mono> createWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (sapLandscapeMonitorParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapLandscapeMonitorParameter is required and cannot be null.")); } else { sapLandscapeMonitorParameter.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, sapLandscapeMonitorParameter, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, + String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -395,57 +329,47 @@ private Mono> createWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (sapLandscapeMonitorParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapLandscapeMonitorParameter is required and cannot be null.")); } else { sapLandscapeMonitorParameter.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, sapLandscapeMonitorParameter, accept, context); } /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + private Mono createAsync(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { return createWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -453,41 +377,37 @@ private Mono createAsync( * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { + public Response createWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { return createWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context).block(); } /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapLandscapeMonitorInner create( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + public SapLandscapeMonitorInner create(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { return createWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, Context.NONE) .getValue(); } /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -498,16 +418,12 @@ public SapLandscapeMonitorInner create( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -518,26 +434,16 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -547,19 +453,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String monitorName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -570,23 +472,15 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); } /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -601,10 +495,9 @@ private Mono deleteAsync(String resourceGroupName, String monitorName) { /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -620,10 +513,9 @@ public Response deleteWithResponse(String resourceGroupName, String monito /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -637,34 +529,29 @@ public void delete(String resourceGroupName, String monitorName) { /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -674,64 +561,45 @@ private Mono> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (sapLandscapeMonitorParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapLandscapeMonitorParameter is required and cannot be null.")); } else { sapLandscapeMonitorParameter.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, sapLandscapeMonitorParameter, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -741,59 +609,47 @@ private Mono> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (sapLandscapeMonitorParameter == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapLandscapeMonitorParameter is required and cannot be null.")); } else { sapLandscapeMonitorParameter.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, sapLandscapeMonitorParameter, accept, context); } /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + private Mono updateAsync(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { return updateWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -801,64 +657,56 @@ private Mono updateAsync( * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { + public Response updateWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { return updateWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context).block(); } /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapLandscapeMonitorInner update( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + public SapLandscapeMonitorInner update(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { return updateWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, Context.NONE) .getValue(); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String monitorName) { + private Mono> listWithResponseAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -869,26 +717,17 @@ private Mono> listWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -896,22 +735,18 @@ private Mono> listWithResponseAsync * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String monitorName, Context context) { + private Mono> listWithResponseAsync(String resourceGroupName, + String monitorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -922,30 +757,23 @@ private Mono> listWithResponseAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - monitorName, - accept, - context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name on successful completion of {@link Mono}. + * group, and resource name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String monitorName) { @@ -954,10 +782,10 @@ private Mono listAsync(String resourceGroupN /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -965,27 +793,27 @@ private Mono listAsync(String resourceGroupN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response listWithResponse(String resourceGroupName, String monitorName, + Context context) { return listWithResponseAsync(resourceGroupName, monitorName, context).block(); } /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) public SapLandscapeMonitorListResultInner list(String resourceGroupName, String monitorName) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsImpl.java index 40ceb0150518..1d18a7af18b6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapLandscapeMonitorsImpl.java @@ -22,21 +22,18 @@ public final class SapLandscapeMonitorsImpl implements SapLandscapeMonitors { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public SapLandscapeMonitorsImpl( - SapLandscapeMonitorsClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public SapLandscapeMonitorsImpl(SapLandscapeMonitorsClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String monitorName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, monitorName, context); + public Response getWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, monitorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,30 +49,22 @@ public SapLandscapeMonitor get(String resourceGroupName, String monitorName) { } } - public Response createWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { - Response inner = - this - .serviceClient() - .createWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); + public Response createWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { + Response inner = this.serviceClient() + .createWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); } else { return null; } } - public SapLandscapeMonitor create( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { - SapLandscapeMonitorInner inner = - this.serviceClient().create(resourceGroupName, monitorName, sapLandscapeMonitorParameter); + public SapLandscapeMonitor create(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + SapLandscapeMonitorInner inner + = this.serviceClient().create(resourceGroupName, monitorName, sapLandscapeMonitorParameter); if (inner != null) { return new SapLandscapeMonitorImpl(inner, this.manager()); } else { @@ -83,8 +72,8 @@ public SapLandscapeMonitor create( } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String monitorName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String monitorName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, monitorName, context); } @@ -92,30 +81,22 @@ public void deleteByResourceGroup(String resourceGroupName, String monitorName) this.serviceClient().delete(resourceGroupName, monitorName); } - public Response updateWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context) { - Response inner = - this - .serviceClient() - .updateWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); + public Response updateWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); } else { return null; } } - public SapLandscapeMonitor update( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { - SapLandscapeMonitorInner inner = - this.serviceClient().update(resourceGroupName, monitorName, sapLandscapeMonitorParameter); + public SapLandscapeMonitor update(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + SapLandscapeMonitorInner inner + = this.serviceClient().update(resourceGroupName, monitorName, sapLandscapeMonitorParameter); if (inner != null) { return new SapLandscapeMonitorImpl(inner, this.manager()); } else { @@ -123,15 +104,12 @@ public SapLandscapeMonitor update( } } - public Response listWithResponse( - String resourceGroupName, String monitorName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, monitorName, context); + public Response listWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, monitorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapLandscapeMonitorListResultImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSizingRecommendationResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSizingRecommendationResultImpl.java index 87ba28129211..0e86b1805d37 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSizingRecommendationResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSizingRecommendationResultImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.workloads.implementation; import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; import com.azure.resourcemanager.workloads.models.SapSizingRecommendationResult; public final class SapSizingRecommendationResultImpl implements SapSizingRecommendationResult { @@ -12,13 +13,16 @@ public final class SapSizingRecommendationResultImpl implements SapSizingRecomme private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapSizingRecommendationResultImpl( - SapSizingRecommendationResultInner innerObject, + SapSizingRecommendationResultImpl(SapSizingRecommendationResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } + public SapDeploymentType deploymentType() { + return this.innerModel().deploymentType(); + } + public SapSizingRecommendationResultInner innerModel() { return this.innerObject; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSupportedResourceSkusResultImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSupportedResourceSkusResultImpl.java index d0c1671e9b10..555204ca1084 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSupportedResourceSkusResultImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSupportedResourceSkusResultImpl.java @@ -15,8 +15,7 @@ public final class SapSupportedResourceSkusResultImpl implements SapSupportedRes private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - SapSupportedResourceSkusResultImpl( - SapSupportedResourceSkusResultInner innerObject, + SapSupportedResourceSkusResultImpl(SapSupportedResourceSkusResultInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstanceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstanceImpl.java index 81c4fe96c069..c54d032b2cd4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstanceImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstanceImpl.java @@ -132,20 +132,16 @@ public SapVirtualInstanceImpl withExistingResourceGroup(String resourceGroupName } public SapVirtualInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), Context.NONE); return this; } public SapVirtualInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), context); return this; } @@ -161,50 +157,43 @@ public SapVirtualInstanceImpl update() { } public SapVirtualInstance apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .updateWithResponse(resourceGroupName, sapVirtualInstanceName, updateBody, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .updateWithResponse(resourceGroupName, sapVirtualInstanceName, updateBody, Context.NONE) + .getValue(); return this; } public SapVirtualInstance apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .updateWithResponse(resourceGroupName, sapVirtualInstanceName, updateBody, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .updateWithResponse(resourceGroupName, sapVirtualInstanceName, updateBody, context) + .getValue(); return this; } - SapVirtualInstanceImpl( - SapVirtualInstanceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + SapVirtualInstanceImpl(SapVirtualInstanceInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); } public SapVirtualInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE) + .getValue(); return this; } public SapVirtualInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSapVirtualInstances() - .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getSapVirtualInstances() + .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context) + .getValue(); return this; } @@ -269,8 +258,8 @@ public SapVirtualInstanceImpl withIdentity(UserAssignedServiceIdentity identity) } } - public SapVirtualInstanceImpl withManagedResourceGroupConfiguration( - ManagedRGConfiguration managedResourceGroupConfiguration) { + public SapVirtualInstanceImpl + withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); return this; } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesClientImpl.java index ed83c3b0adce..0e0b1df0bad9 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesClientImpl.java @@ -43,22 +43,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. + */ public final class SapVirtualInstancesClientImpl implements SapVirtualInstancesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SapVirtualInstancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final WorkloadsClientImpl client; /** * Initializes an instance of SapVirtualInstancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SapVirtualInstancesClientImpl(WorkloadsClientImpl client) { - this.service = - RestProxy.create(SapVirtualInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SapVirtualInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -69,141 +75,107 @@ public final class SapVirtualInstancesClientImpl implements SapVirtualInstancesC @Host("{$host}") @ServiceInterface(name = "WorkloadsClientSapVi") public interface SapVirtualInstancesService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SapVirtualInstanceInner body, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SapVirtualInstanceInner body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, + Mono> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSapVirtualInstanceRequest body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSapVirtualInstanceRequest body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, + Mono>> start(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, + Mono>> stop(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StopRequest body, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -211,55 +183,40 @@ Mono> listBySubscriptionNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, SapVirtualInstanceInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -268,52 +225,39 @@ private Mono>> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -323,23 +267,18 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapVirtualInstanceInner.class, - SapVirtualInstanceInner.class, - this.client.getContext()); + private PollerFlux, SapVirtualInstanceInner> + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapVirtualInstanceInner.class, SapVirtualInstanceInner.class, + this.client.getContext()); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -348,24 +287,19 @@ private PollerFlux, SapVirtualInstanceInner> * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private PollerFlux, SapVirtualInstanceInner> + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName) { final SapVirtualInstanceInner body = null; - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapVirtualInstanceInner.class, - SapVirtualInstanceInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapVirtualInstanceInner.class, SapVirtualInstanceInner.class, + this.client.getContext()); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -379,21 +313,15 @@ private PollerFlux, SapVirtualInstanceInner> private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SapVirtualInstanceInner.class, - SapVirtualInstanceInner.class, - context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SapVirtualInstanceInner.class, SapVirtualInstanceInner.class, context); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -402,15 +330,15 @@ private PollerFlux, SapVirtualInstanceInner> * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SapVirtualInstanceInner> beginCreate( - String resourceGroupName, String sapVirtualInstanceName) { + public SyncPoller, SapVirtualInstanceInner> + beginCreate(String resourceGroupName, String sapVirtualInstanceName) { final SapVirtualInstanceInner body = null; return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -428,7 +356,7 @@ public SyncPoller, SapVirtualInstanceInner> /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -438,16 +366,15 @@ public SyncPoller, SapVirtualInstanceInner> * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + SapVirtualInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -458,14 +385,13 @@ private Mono createAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName) { final SapVirtualInstanceInner body = null; - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body) - .last() + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -476,16 +402,15 @@ private Mono createAsync(String resourceGroupName, Stri * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { - return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body, context) - .last() + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName, + SapVirtualInstanceInner body, Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -501,7 +426,7 @@ public SapVirtualInstanceInner create(String resourceGroupName, String sapVirtua /** * Creates a Virtual Instance for SAP solutions (VIS) resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Virtual Instance for SAP solutions resource request body. @@ -512,65 +437,52 @@ public SapVirtualInstanceInner create(String resourceGroupName, String sapVirtua * @return define the Virtual Instance for SAP solutions resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SapVirtualInstanceInner create( - String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + public SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName, + SapVirtualInstanceInner body, Context context) { return createAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); } /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Virtual Instance for SAP solutions resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -578,48 +490,36 @@ private Mono> getByResourceGroupWithResponseAs * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Virtual Instance for SAP solutions resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), accept, context); } /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -628,15 +528,15 @@ private Mono> getByResourceGroupWithResponseAs * @return a Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono getByResourceGroupAsync(String resourceGroupName, + String sapVirtualInstanceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -646,14 +546,14 @@ private Mono getByResourceGroupAsync( * @return a Virtual Instance for SAP solutions resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String sapVirtualInstanceName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context).block(); } /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -668,7 +568,7 @@ public SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, Stri /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Request body to update a Virtual Instance for SAP solutions resource. @@ -676,55 +576,40 @@ public SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, Stri * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Request body to update a Virtual Instance for SAP solutions resource. @@ -733,55 +618,39 @@ private Mono> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String sapVirtualInstanceName, - UpdateSapVirtualInstanceRequest body, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -798,7 +667,7 @@ private Mono updateAsync(String resourceGroupName, Stri /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body Request body to update a Virtual Instance for SAP solutions resource. @@ -809,17 +678,14 @@ private Mono updateAsync(String resourceGroupName, Stri * @return define the Virtual Instance for SAP solutions resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String sapVirtualInstanceName, - UpdateSapVirtualInstanceRequest body, - Context context) { + public Response updateWithResponse(String resourceGroupName, String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, Context context) { return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); } /** * Updates a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -836,109 +702,83 @@ public SapVirtualInstanceInner update(String resourceGroupName, String sapVirtua /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), accept, context); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -947,23 +787,18 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String sapVirtualInstanceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -973,25 +808,19 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginDeleteAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginDeleteAsync(String resourceGroupName, String sapVirtualInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1000,15 +829,15 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String sapVirtualInstanceName) { return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName).getSyncPoller(); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1018,15 +847,15 @@ public SyncPoller, OperationStatusResultI * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginDelete( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginDelete(String resourceGroupName, String sapVirtualInstanceName, Context context) { return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context).getSyncPoller(); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1036,15 +865,14 @@ public SyncPoller, OperationStatusResultI */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName) - .last() + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1054,17 +882,16 @@ private Mono deleteAsync(String resourceGroupName, S * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1080,7 +907,7 @@ public OperationStatusResultInner delete(String resourceGroupName, String sapVir /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1096,27 +923,23 @@ public OperationStatusResultInner delete(String resourceGroupName, String sapVir /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Virtual Instances for SAP solutions resources in a Resource Group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1124,53 +947,34 @@ private Mono> listByResourceGroupSinglePa } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Virtual Instances for SAP solutions resources in a Resource Group along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1179,68 +983,54 @@ private Mono> listByResourceGroupSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedFlux}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedFlux}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1249,14 +1039,14 @@ public PagedIterable listByResourceGroup(String resourc /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1265,130 +1055,97 @@ public PagedIterable listByResourceGroup(String resourc /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Virtual Instances for SAP solutions resources in a Subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all Virtual Instances for SAP solutions resources in a Subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedFlux}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedFlux}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1397,13 +1154,13 @@ public PagedIterable list() { /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1412,107 +1169,81 @@ public PagedIterable list(Context context) { /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private Mono>> startWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private Mono>> startWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - accept, - context); + return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), accept, context); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1521,22 +1252,17 @@ private Mono>> startWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStartAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private PollerFlux, OperationStatusResultInner> + beginStartAsync(String resourceGroupName, String sapVirtualInstanceName) { Mono>> mono = startWithResponseAsync(resourceGroupName, sapVirtualInstanceName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1546,24 +1272,18 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStartAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + private PollerFlux, OperationStatusResultInner> + beginStartAsync(String resourceGroupName, String sapVirtualInstanceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = startWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1572,14 +1292,14 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStart( - String resourceGroupName, String sapVirtualInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginStart(String resourceGroupName, String sapVirtualInstanceName) { return this.beginStartAsync(resourceGroupName, sapVirtualInstanceName).getSyncPoller(); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1589,14 +1309,14 @@ public SyncPoller, OperationStatusResultI * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStart( - String resourceGroupName, String sapVirtualInstanceName, Context context) { + public SyncPoller, OperationStatusResultInner> + beginStart(String resourceGroupName, String sapVirtualInstanceName, Context context) { return this.beginStartAsync(resourceGroupName, sapVirtualInstanceName, context).getSyncPoller(); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1606,14 +1326,13 @@ public SyncPoller, OperationStatusResultI */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String sapVirtualInstanceName) { - return beginStartAsync(resourceGroupName, sapVirtualInstanceName) - .last() + return beginStartAsync(resourceGroupName, sapVirtualInstanceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1623,16 +1342,15 @@ private Mono startAsync(String resourceGroupName, St * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - return beginStartAsync(resourceGroupName, sapVirtualInstanceName, context) - .last() + private Mono startAsync(String resourceGroupName, String sapVirtualInstanceName, + Context context) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1647,7 +1365,7 @@ public OperationStatusResultInner start(String resourceGroupName, String sapVirt /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -1663,63 +1381,48 @@ public OperationStatusResultInner start(String resourceGroupName, String sapVirt /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + private Mono>> stopWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, StopRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1727,53 +1430,40 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current status of an async operation along with {@link Response} on successful completion of {@link - * Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + private Mono>> stopWithResponseAsync(String resourceGroupName, + String sapVirtualInstanceName, StopRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (sapVirtualInstanceName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - sapVirtualInstanceName, - this.client.getApiVersion(), - body, - accept, - context); + return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sapVirtualInstanceName, this.client.getApiVersion(), body, accept, context); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1783,22 +1473,17 @@ private Mono>> stopWithResponseAsync( * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStopAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + private PollerFlux, OperationStatusResultInner> + beginStopAsync(String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { Mono>> mono = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1807,23 +1492,18 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStopAsync( - String resourceGroupName, String sapVirtualInstanceName) { + private PollerFlux, OperationStatusResultInner> + beginStopAsync(String resourceGroupName, String sapVirtualInstanceName) { final StopRequest body = null; Mono>> mono = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1834,24 +1514,18 @@ private PollerFlux, OperationStatusResult * @return the {@link PollerFlux} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OperationStatusResultInner> beginStopAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + private PollerFlux, OperationStatusResultInner> + beginStopAsync(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - OperationStatusResultInner.class, - OperationStatusResultInner.class, - context); + Mono>> mono + = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1860,15 +1534,15 @@ private PollerFlux, OperationStatusResult * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStop( - String resourceGroupName, String sapVirtualInstanceName) { + public SyncPoller, OperationStatusResultInner> + beginStop(String resourceGroupName, String sapVirtualInstanceName) { final StopRequest body = null; return this.beginStopAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1879,14 +1553,14 @@ public SyncPoller, OperationStatusResultI * @return the {@link SyncPoller} for polling of the current status of an async operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OperationStatusResultInner> beginStop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + public SyncPoller, OperationStatusResultInner> + beginStop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { return this.beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1896,16 +1570,15 @@ public SyncPoller, OperationStatusResultI * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { - return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body) - .last() + private Mono stopAsync(String resourceGroupName, String sapVirtualInstanceName, + StopRequest body) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1916,14 +1589,13 @@ private Mono stopAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String sapVirtualInstanceName) { final StopRequest body = null; - return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body) - .last() + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1934,16 +1606,15 @@ private Mono stopAsync(String resourceGroupName, Str * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { - return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context) - .last() + private Mono stopAsync(String resourceGroupName, String sapVirtualInstanceName, + StopRequest body, Context context) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1959,7 +1630,7 @@ public OperationStatusResultInner stop(String resourceGroupName, String sapVirtu /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -1970,21 +1641,20 @@ public OperationStatusResultInner stop(String resourceGroupName, String sapVirtu * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner stop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + public OperationStatusResultInner stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, + Context context) { return stopAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1992,76 +1662,55 @@ private Mono> listByResourceGroupNextSing return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -2069,63 +1718,43 @@ private Mono> listBySubscriptionNextSingl return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesImpl.java index 03a0962bfaf9..ec858f5c2099 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesImpl.java @@ -24,21 +24,18 @@ public final class SapVirtualInstancesImpl implements SapVirtualInstances { private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; - public SapVirtualInstancesImpl( - SapVirtualInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + public SapVirtualInstancesImpl(SapVirtualInstancesClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sapVirtualInstanceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String sapVirtualInstanceName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SapVirtualInstanceImpl(inner.getValue(), this.manager())); } else { return null; @@ -46,8 +43,8 @@ public Response getByResourceGroupWithResponse( } public SapVirtualInstance getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { - SapVirtualInstanceInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, sapVirtualInstanceName); if (inner != null) { return new SapVirtualInstanceImpl(inner, this.manager()); } else { @@ -65,8 +62,8 @@ public OperationStatusResult deleteByResourceGroup(String resourceGroupName, Str } public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, context); + OperationStatusResultInner inner + = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -76,23 +73,23 @@ public OperationStatusResult delete(String resourceGroupName, String sapVirtualI public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); } public OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName) { @@ -105,8 +102,8 @@ public OperationStatusResult start(String resourceGroupName, String sapVirtualIn } public OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName, Context context) { - OperationStatusResultInner inner = - this.serviceClient().start(resourceGroupName, sapVirtualInstanceName, context); + OperationStatusResultInner inner + = this.serviceClient().start(resourceGroupName, sapVirtualInstanceName, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -123,10 +120,10 @@ public OperationStatusResult stop(String resourceGroupName, String sapVirtualIns } } - public OperationStatusResult stop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { - OperationStatusResultInner inner = - this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName, body, context); + public OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName, body, context); if (inner != null) { return new OperationStatusResultImpl(inner, this.manager()); } else { @@ -135,85 +132,57 @@ public OperationStatusResult stop( } public SapVirtualInstance getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); } public OperationStatusResult deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, Context.NONE); } public OperationStatusResult deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + String sapVirtualInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "sapVirtualInstances"); if (sapVirtualInstanceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); } return this.delete(resourceGroupName, sapVirtualInstanceName, context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientBuilder.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientBuilder.java index 6db732ae69d5..4c95c40169ff 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientBuilder.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the WorkloadsClientImpl type. */ -@ServiceClientBuilder(serviceClients = {WorkloadsClientImpl.class}) +/** + * A builder for creating a new instance of the WorkloadsClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { WorkloadsClientImpl.class }) public final class WorkloadsClientBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class WorkloadsClientBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the WorkloadsClientBuilder. */ @@ -40,7 +42,7 @@ public WorkloadsClientBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the WorkloadsClientBuilder. */ @@ -56,7 +58,7 @@ public WorkloadsClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the WorkloadsClientBuilder. */ @@ -72,7 +74,7 @@ public WorkloadsClientBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the WorkloadsClientBuilder. */ @@ -88,7 +90,7 @@ public WorkloadsClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the WorkloadsClientBuilder. */ @@ -104,7 +106,7 @@ public WorkloadsClientBuilder defaultPollInterval(Duration defaultPollInterval) /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the WorkloadsClientBuilder. */ @@ -115,30 +117,22 @@ public WorkloadsClientBuilder serializerAdapter(SerializerAdapter serializerAdap /** * Builds an instance of WorkloadsClientImpl with the provided parameters. - * + * * @return an instance of WorkloadsClientImpl. */ public WorkloadsClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - WorkloadsClientImpl client = - new WorkloadsClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + WorkloadsClientImpl client = new WorkloadsClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientImpl.java index 639c8f9398c2..c46c5e364b51 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientImpl.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WorkloadsClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.workloads.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -41,183 +42,215 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the WorkloadsClientImpl type. */ +/** + * Initializes a new instance of the WorkloadsClientImpl type. + */ @ServiceClient(builder = WorkloadsClientBuilder.class) public final class WorkloadsClientImpl implements WorkloadsClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ResourceProvidersClient object to access its operations. */ + /** + * The ResourceProvidersClient object to access its operations. + */ private final ResourceProvidersClient resourceProviders; /** * Gets the ResourceProvidersClient object to access its operations. - * + * * @return the ResourceProvidersClient object. */ public ResourceProvidersClient getResourceProviders() { return this.resourceProviders; } - /** The SapVirtualInstancesClient object to access its operations. */ + /** + * The SapVirtualInstancesClient object to access its operations. + */ private final SapVirtualInstancesClient sapVirtualInstances; /** * Gets the SapVirtualInstancesClient object to access its operations. - * + * * @return the SapVirtualInstancesClient object. */ public SapVirtualInstancesClient getSapVirtualInstances() { return this.sapVirtualInstances; } - /** The SapCentralInstancesClient object to access its operations. */ + /** + * The SapCentralInstancesClient object to access its operations. + */ private final SapCentralInstancesClient sapCentralInstances; /** * Gets the SapCentralInstancesClient object to access its operations. - * + * * @return the SapCentralInstancesClient object. */ public SapCentralInstancesClient getSapCentralInstances() { return this.sapCentralInstances; } - /** The SapDatabaseInstancesClient object to access its operations. */ + /** + * The SapDatabaseInstancesClient object to access its operations. + */ private final SapDatabaseInstancesClient sapDatabaseInstances; /** * Gets the SapDatabaseInstancesClient object to access its operations. - * + * * @return the SapDatabaseInstancesClient object. */ public SapDatabaseInstancesClient getSapDatabaseInstances() { return this.sapDatabaseInstances; } - /** The SapApplicationServerInstancesClient object to access its operations. */ + /** + * The SapApplicationServerInstancesClient object to access its operations. + */ private final SapApplicationServerInstancesClient sapApplicationServerInstances; /** * Gets the SapApplicationServerInstancesClient object to access its operations. - * + * * @return the SapApplicationServerInstancesClient object. */ public SapApplicationServerInstancesClient getSapApplicationServerInstances() { return this.sapApplicationServerInstances; } - /** The MonitorsClient object to access its operations. */ + /** + * The MonitorsClient object to access its operations. + */ private final MonitorsClient monitors; /** * Gets the MonitorsClient object to access its operations. - * + * * @return the MonitorsClient object. */ public MonitorsClient getMonitors() { return this.monitors; } - /** The ProviderInstancesClient object to access its operations. */ + /** + * The ProviderInstancesClient object to access its operations. + */ private final ProviderInstancesClient providerInstances; /** * Gets the ProviderInstancesClient object to access its operations. - * + * * @return the ProviderInstancesClient object. */ public ProviderInstancesClient getProviderInstances() { return this.providerInstances; } - /** The SapLandscapeMonitorsClient object to access its operations. */ + /** + * The SapLandscapeMonitorsClient object to access its operations. + */ private final SapLandscapeMonitorsClient sapLandscapeMonitors; /** * Gets the SapLandscapeMonitorsClient object to access its operations. - * + * * @return the SapLandscapeMonitorsClient object. */ public SapLandscapeMonitorsClient getSapLandscapeMonitors() { return this.sapLandscapeMonitors; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { @@ -226,7 +259,7 @@ public OperationsClient getOperations() { /** * Initializes an instance of WorkloadsClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -234,13 +267,8 @@ public OperationsClient getOperations() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - WorkloadsClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + WorkloadsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; @@ -260,7 +288,7 @@ public OperationsClient getOperations() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -269,7 +297,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -279,7 +307,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -289,26 +317,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -321,19 +338,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -374,7 +388,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/package-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/package-info.java index 57bcb0111fd3..53e2749a627f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/package-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/package-info.java @@ -3,10 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for WorkloadsClient. Workloads client provides access to various workload - * operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - * - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Package containing the implementations for WorkloadsClient. + * Workloads client provides access to various workload operations. */ package com.azure.resourcemanager.workloads.implementation; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ActionType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ActionType.java index 80ea8ea5afb8..299a2b7a395b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ActionType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ActionType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerConfiguration.java index fb143f9ba960..3c7c5578bfac 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerConfiguration.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the application server configuration. */ +/** + * Gets or sets the application server configuration. + */ @Fluent -public final class ApplicationServerConfiguration { +public final class ApplicationServerConfiguration implements JsonSerializable { /* * The subnet id. */ - @JsonProperty(value = "subnetId", required = true) private String subnetId; /* * Gets or sets the virtual machine configuration. */ - @JsonProperty(value = "virtualMachineConfiguration", required = true) private VirtualMachineConfiguration virtualMachineConfiguration; /* * The number of app server instances. */ - @JsonProperty(value = "instanceCount", required = true) private long instanceCount; - /** Creates an instance of ApplicationServerConfiguration class. */ + /** + * Creates an instance of ApplicationServerConfiguration class. + */ public ApplicationServerConfiguration() { } /** * Get the subnetId property: The subnet id. - * + * * @return the subnetId value. */ public String subnetId() { @@ -44,7 +49,7 @@ public String subnetId() { /** * Set the subnetId property: The subnet id. - * + * * @param subnetId the subnetId value to set. * @return the ApplicationServerConfiguration object itself. */ @@ -55,7 +60,7 @@ public ApplicationServerConfiguration withSubnetId(String subnetId) { /** * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @return the virtualMachineConfiguration value. */ public VirtualMachineConfiguration virtualMachineConfiguration() { @@ -64,19 +69,19 @@ public VirtualMachineConfiguration virtualMachineConfiguration() { /** * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. * @return the ApplicationServerConfiguration object itself. */ - public ApplicationServerConfiguration withVirtualMachineConfiguration( - VirtualMachineConfiguration virtualMachineConfiguration) { + public ApplicationServerConfiguration + withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { this.virtualMachineConfiguration = virtualMachineConfiguration; return this; } /** * Get the instanceCount property: The number of app server instances. - * + * * @return the instanceCount value. */ public long instanceCount() { @@ -85,7 +90,7 @@ public long instanceCount() { /** * Set the instanceCount property: The number of app server instances. - * + * * @param instanceCount the instanceCount value to set. * @return the ApplicationServerConfiguration object itself. */ @@ -96,26 +101,68 @@ public ApplicationServerConfiguration withInstanceCount(long instanceCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (subnetId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property subnetId in model ApplicationServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subnetId in model ApplicationServerConfiguration")); } if (virtualMachineConfiguration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachineConfiguration in model" - + " ApplicationServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model ApplicationServerConfiguration")); } else { virtualMachineConfiguration().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ApplicationServerConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeLongField("instanceCount", this.instanceCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationServerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationServerConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationServerConfiguration. + */ + public static ApplicationServerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationServerConfiguration deserializedApplicationServerConfiguration + = new ApplicationServerConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedApplicationServerConfiguration.subnetId = reader.getString(); + } else if ("virtualMachineConfiguration".equals(fieldName)) { + deserializedApplicationServerConfiguration.virtualMachineConfiguration + = VirtualMachineConfiguration.fromJson(reader); + } else if ("instanceCount".equals(fieldName)) { + deserializedApplicationServerConfiguration.instanceCount = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationServerConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerFullResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerFullResourceNames.java index 27baeca86697..38683e7135ab 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerFullResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerFullResourceNames.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,26 +17,26 @@ * the number VMs to be created for application layer. */ @Fluent -public final class ApplicationServerFullResourceNames { +public final class ApplicationServerFullResourceNames implements JsonSerializable { /* * The list of virtual machine naming details. */ - @JsonProperty(value = "virtualMachines") private List virtualMachines; /* * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. */ - @JsonProperty(value = "availabilitySetName") private String availabilitySetName; - /** Creates an instance of ApplicationServerFullResourceNames class. */ + /** + * Creates an instance of ApplicationServerFullResourceNames class. + */ public ApplicationServerFullResourceNames() { } /** * Get the virtualMachines property: The list of virtual machine naming details. - * + * * @return the virtualMachines value. */ public List virtualMachines() { @@ -41,7 +45,7 @@ public List virtualMachines() { /** * Set the virtualMachines property: The list of virtual machine naming details. - * + * * @param virtualMachines the virtualMachines value to set. * @return the ApplicationServerFullResourceNames object itself. */ @@ -53,7 +57,7 @@ public ApplicationServerFullResourceNames withVirtualMachines(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("virtualMachines", this.virtualMachines, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("availabilitySetName", this.availabilitySetName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationServerFullResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationServerFullResourceNames if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationServerFullResourceNames. + */ + public static ApplicationServerFullResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationServerFullResourceNames deserializedApplicationServerFullResourceNames + = new ApplicationServerFullResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachines".equals(fieldName)) { + List virtualMachines + = reader.readArray(reader1 -> VirtualMachineResourceNames.fromJson(reader1)); + deserializedApplicationServerFullResourceNames.virtualMachines = virtualMachines; + } else if ("availabilitySetName".equals(fieldName)) { + deserializedApplicationServerFullResourceNames.availabilitySetName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationServerFullResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVirtualMachineType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVirtualMachineType.java index 67e0edf047bd..b8404f48e921 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVirtualMachineType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVirtualMachineType.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the type of application server VM. */ +/** + * Defines the type of application server VM. + */ public final class ApplicationServerVirtualMachineType extends ExpandableStringEnum { - /** Static value Active for ApplicationServerVirtualMachineType. */ + /** + * Static value Active for ApplicationServerVirtualMachineType. + */ public static final ApplicationServerVirtualMachineType ACTIVE = fromString("Active"); - /** Static value Standby for ApplicationServerVirtualMachineType. */ + /** + * Static value Standby for ApplicationServerVirtualMachineType. + */ public static final ApplicationServerVirtualMachineType STANDBY = fromString("Standby"); - /** Static value Unknown for ApplicationServerVirtualMachineType. */ + /** + * Static value Unknown for ApplicationServerVirtualMachineType. + */ public static final ApplicationServerVirtualMachineType UNKNOWN = fromString("Unknown"); /** * Creates a new instance of ApplicationServerVirtualMachineType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public ApplicationServerVirtualMachineType() { /** * Creates or finds a ApplicationServerVirtualMachineType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationServerVirtualMachineType. */ - @JsonCreator public static ApplicationServerVirtualMachineType fromString(String name) { return fromString(name, ApplicationServerVirtualMachineType.class); } /** * Gets known ApplicationServerVirtualMachineType values. - * + * * @return known ApplicationServerVirtualMachineType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVmDetails.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVmDetails.java index f91351c187da..e57292bbbc65 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVmDetails.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerVmDetails.java @@ -5,38 +5,43 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The Application Server VM Details. */ +/** + * The Application Server VM Details. + */ @Immutable -public final class ApplicationServerVmDetails { +public final class ApplicationServerVmDetails implements JsonSerializable { /* * Defines the type of application server VM. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private ApplicationServerVirtualMachineType type; /* * The virtualMachineId property. */ - @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) private String virtualMachineId; /* * Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared * Storage. */ - @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) private List storageDetails; - /** Creates an instance of ApplicationServerVmDetails class. */ + /** + * Creates an instance of ApplicationServerVmDetails class. + */ public ApplicationServerVmDetails() { } /** * Get the type property: Defines the type of application server VM. - * + * * @return the type value. */ public ApplicationServerVirtualMachineType type() { @@ -45,7 +50,7 @@ public ApplicationServerVirtualMachineType type() { /** * Get the virtualMachineId property: The virtualMachineId property. - * + * * @return the virtualMachineId value. */ public String virtualMachineId() { @@ -55,7 +60,7 @@ public String virtualMachineId() { /** * Get the storageDetails property: Storage details of all the Storage Accounts attached to the App Virtual Machine. * For e.g. NFS on AFS Shared Storage. - * + * * @return the storageDetails value. */ public List storageDetails() { @@ -64,7 +69,7 @@ public List storageDetails() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -72,4 +77,46 @@ public void validate() { storageDetails().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationServerVmDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationServerVmDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationServerVmDetails. + */ + public static ApplicationServerVmDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationServerVmDetails deserializedApplicationServerVmDetails = new ApplicationServerVmDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedApplicationServerVmDetails.type + = ApplicationServerVirtualMachineType.fromString(reader.getString()); + } else if ("virtualMachineId".equals(fieldName)) { + deserializedApplicationServerVmDetails.virtualMachineId = reader.getString(); + } else if ("storageDetails".equals(fieldName)) { + List storageDetails + = reader.readArray(reader1 -> StorageInformation.fromJson(reader1)); + deserializedApplicationServerVmDetails.storageDetails = storageDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationServerVmDetails; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerConfiguration.java index dfa832f234e2..779c87ba7474 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerConfiguration.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the central server configuration. */ +/** + * Gets or sets the central server configuration. + */ @Fluent -public final class CentralServerConfiguration { +public final class CentralServerConfiguration implements JsonSerializable { /* * The subnet id. */ - @JsonProperty(value = "subnetId", required = true) private String subnetId; /* * Gets or sets the virtual machine configuration. */ - @JsonProperty(value = "virtualMachineConfiguration", required = true) private VirtualMachineConfiguration virtualMachineConfiguration; /* * The number of central server VMs. */ - @JsonProperty(value = "instanceCount", required = true) private long instanceCount; - /** Creates an instance of CentralServerConfiguration class. */ + /** + * Creates an instance of CentralServerConfiguration class. + */ public CentralServerConfiguration() { } /** * Get the subnetId property: The subnet id. - * + * * @return the subnetId value. */ public String subnetId() { @@ -44,7 +49,7 @@ public String subnetId() { /** * Set the subnetId property: The subnet id. - * + * * @param subnetId the subnetId value to set. * @return the CentralServerConfiguration object itself. */ @@ -55,7 +60,7 @@ public CentralServerConfiguration withSubnetId(String subnetId) { /** * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @return the virtualMachineConfiguration value. */ public VirtualMachineConfiguration virtualMachineConfiguration() { @@ -64,19 +69,19 @@ public VirtualMachineConfiguration virtualMachineConfiguration() { /** * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. * @return the CentralServerConfiguration object itself. */ - public CentralServerConfiguration withVirtualMachineConfiguration( - VirtualMachineConfiguration virtualMachineConfiguration) { + public CentralServerConfiguration + withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { this.virtualMachineConfiguration = virtualMachineConfiguration; return this; } /** * Get the instanceCount property: The number of central server VMs. - * + * * @return the instanceCount value. */ public long instanceCount() { @@ -85,7 +90,7 @@ public long instanceCount() { /** * Set the instanceCount property: The number of central server VMs. - * + * * @param instanceCount the instanceCount value to set. * @return the CentralServerConfiguration object itself. */ @@ -96,25 +101,67 @@ public CentralServerConfiguration withInstanceCount(long instanceCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (subnetId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property subnetId in model CentralServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subnetId in model CentralServerConfiguration")); } if (virtualMachineConfiguration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachineConfiguration in model CentralServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model CentralServerConfiguration")); } else { virtualMachineConfiguration().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(CentralServerConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeLongField("instanceCount", this.instanceCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CentralServerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CentralServerConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CentralServerConfiguration. + */ + public static CentralServerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CentralServerConfiguration deserializedCentralServerConfiguration = new CentralServerConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedCentralServerConfiguration.subnetId = reader.getString(); + } else if ("virtualMachineConfiguration".equals(fieldName)) { + deserializedCentralServerConfiguration.virtualMachineConfiguration + = VirtualMachineConfiguration.fromJson(reader); + } else if ("instanceCount".equals(fieldName)) { + deserializedCentralServerConfiguration.instanceCount = reader.getLong(); + } else { + reader.skipChildren(); + } + } + + return deserializedCentralServerConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerFullResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerFullResourceNames.java index 5f01523fc0d0..d90b4b3d503a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerFullResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerFullResourceNames.java @@ -5,33 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The full resource names object for central server layer resources. */ +/** + * The full resource names object for central server layer resources. + */ @Fluent -public final class CentralServerFullResourceNames { +public final class CentralServerFullResourceNames implements JsonSerializable { /* * The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be * equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this * layer: ASCS and ERS. */ - @JsonProperty(value = "virtualMachines") private List virtualMachines; /* * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. */ - @JsonProperty(value = "availabilitySetName") private String availabilitySetName; /* * The resource names object for load balancer and related resources. */ - @JsonProperty(value = "loadBalancer") private LoadBalancerResourceNames loadBalancer; - /** Creates an instance of CentralServerFullResourceNames class. */ + /** + * Creates an instance of CentralServerFullResourceNames class. + */ public CentralServerFullResourceNames() { } @@ -39,7 +44,7 @@ public CentralServerFullResourceNames() { * Get the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two * virtual machines at this layer: ASCS and ERS. - * + * * @return the virtualMachines value. */ public List virtualMachines() { @@ -50,7 +55,7 @@ public List virtualMachines() { * Set the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two * virtual machines at this layer: ASCS and ERS. - * + * * @param virtualMachines the virtualMachines value to set. * @return the CentralServerFullResourceNames object itself. */ @@ -62,7 +67,7 @@ public CentralServerFullResourceNames withVirtualMachines(List writer.writeJson(element)); + jsonWriter.writeStringField("availabilitySetName", this.availabilitySetName); + jsonWriter.writeJsonField("loadBalancer", this.loadBalancer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CentralServerFullResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CentralServerFullResourceNames if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CentralServerFullResourceNames. + */ + public static CentralServerFullResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CentralServerFullResourceNames deserializedCentralServerFullResourceNames + = new CentralServerFullResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachines".equals(fieldName)) { + List virtualMachines + = reader.readArray(reader1 -> VirtualMachineResourceNames.fromJson(reader1)); + deserializedCentralServerFullResourceNames.virtualMachines = virtualMachines; + } else if ("availabilitySetName".equals(fieldName)) { + deserializedCentralServerFullResourceNames.availabilitySetName = reader.getString(); + } else if ("loadBalancer".equals(fieldName)) { + deserializedCentralServerFullResourceNames.loadBalancer + = LoadBalancerResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCentralServerFullResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVirtualMachineType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVirtualMachineType.java index 9c0379a58a1e..f102df24f24f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVirtualMachineType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVirtualMachineType.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the type of central server VM. */ +/** + * Defines the type of central server VM. + */ public final class CentralServerVirtualMachineType extends ExpandableStringEnum { - /** Static value Primary for CentralServerVirtualMachineType. */ + /** + * Static value Primary for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType PRIMARY = fromString("Primary"); - /** Static value Secondary for CentralServerVirtualMachineType. */ + /** + * Static value Secondary for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType SECONDARY = fromString("Secondary"); - /** Static value Unknown for CentralServerVirtualMachineType. */ + /** + * Static value Unknown for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType UNKNOWN = fromString("Unknown"); - /** Static value ASCS for CentralServerVirtualMachineType. */ + /** + * Static value ASCS for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType ASCS = fromString("ASCS"); - /** Static value ERSInactive for CentralServerVirtualMachineType. */ + /** + * Static value ERSInactive for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType ERSINACTIVE = fromString("ERSInactive"); - /** Static value ERS for CentralServerVirtualMachineType. */ + /** + * Static value ERS for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType ERS = fromString("ERS"); - /** Static value Standby for CentralServerVirtualMachineType. */ + /** + * Static value Standby for CentralServerVirtualMachineType. + */ public static final CentralServerVirtualMachineType STANDBY = fromString("Standby"); /** * Creates a new instance of CentralServerVirtualMachineType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public CentralServerVirtualMachineType() { /** * Creates or finds a CentralServerVirtualMachineType from its string representation. - * + * * @param name a name to look for. * @return the corresponding CentralServerVirtualMachineType. */ - @JsonCreator public static CentralServerVirtualMachineType fromString(String name) { return fromString(name, CentralServerVirtualMachineType.class); } /** * Gets known CentralServerVirtualMachineType values. - * + * * @return known CentralServerVirtualMachineType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVmDetails.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVmDetails.java index e00c49d83e25..ed316909b199 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVmDetails.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVmDetails.java @@ -5,38 +5,43 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The SAP Central Services Instance VM details. */ +/** + * The SAP Central Services Instance VM details. + */ @Immutable -public final class CentralServerVmDetails { +public final class CentralServerVmDetails implements JsonSerializable { /* * Defines the type of central server VM. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private CentralServerVirtualMachineType type; /* * The virtualMachineId property. */ - @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) private String virtualMachineId; /* * Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared * Storage. */ - @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) private List storageDetails; - /** Creates an instance of CentralServerVmDetails class. */ + /** + * Creates an instance of CentralServerVmDetails class. + */ public CentralServerVmDetails() { } /** * Get the type property: Defines the type of central server VM. - * + * * @return the type value. */ public CentralServerVirtualMachineType type() { @@ -45,7 +50,7 @@ public CentralServerVirtualMachineType type() { /** * Get the virtualMachineId property: The virtualMachineId property. - * + * * @return the virtualMachineId value. */ public String virtualMachineId() { @@ -55,7 +60,7 @@ public String virtualMachineId() { /** * Get the storageDetails property: Storage details of all the Storage Accounts attached to the ASCS Virtual * Machine. For e.g. NFS on AFS Shared Storage. - * + * * @return the storageDetails value. */ public List storageDetails() { @@ -64,7 +69,7 @@ public List storageDetails() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -72,4 +77,46 @@ public void validate() { storageDetails().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CentralServerVmDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CentralServerVmDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CentralServerVmDetails. + */ + public static CentralServerVmDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CentralServerVmDetails deserializedCentralServerVmDetails = new CentralServerVmDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCentralServerVmDetails.type + = CentralServerVirtualMachineType.fromString(reader.getString()); + } else if ("virtualMachineId".equals(fieldName)) { + deserializedCentralServerVmDetails.virtualMachineId = reader.getString(); + } else if ("storageDetails".equals(fieldName)) { + List storageDetails + = reader.readArray(reader1 -> StorageInformation.fromJson(reader1)); + deserializedCentralServerVmDetails.storageDetails = storageDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedCentralServerVmDetails; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ConfigurationType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ConfigurationType.java index d6ca0ec0d81b..b8670d1752ee 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ConfigurationType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ConfigurationType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of file share config. */ +/** + * The type of file share config. + */ public final class ConfigurationType extends ExpandableStringEnum { - /** Static value Skip for ConfigurationType. */ + /** + * Static value Skip for ConfigurationType. + */ public static final ConfigurationType SKIP = fromString("Skip"); - /** Static value CreateAndMount for ConfigurationType. */ + /** + * Static value CreateAndMount for ConfigurationType. + */ public static final ConfigurationType CREATE_AND_MOUNT = fromString("CreateAndMount"); - /** Static value Mount for ConfigurationType. */ + /** + * Static value Mount for ConfigurationType. + */ public static final ConfigurationType MOUNT = fromString("Mount"); /** * Creates a new instance of ConfigurationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public ConfigurationType() { /** * Creates or finds a ConfigurationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConfigurationType. */ - @JsonCreator public static ConfigurationType fromString(String name) { return fromString(name, ConfigurationType.class); } /** * Gets known ConfigurationType values. - * + * * @return known ConfigurationType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CreateAndMountFileShareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CreateAndMountFileShareConfiguration.java index 483210ee7c67..bc02bc277f59 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CreateAndMountFileShareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CreateAndMountFileShareConfiguration.java @@ -5,40 +5,54 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets the file share configuration where the transport directory fileshare is created and mounted as a part of * the create infra flow. Please pre-create the resource group you intend to place the transport directory in. The * storage account and fileshare will be auto-created by the ACSS and doesn’t need to pre-created. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("CreateAndMount") @Fluent public final class CreateAndMountFileShareConfiguration extends FileShareConfiguration { + /* + * The type of file share config. + */ + private ConfigurationType configurationType = ConfigurationType.CREATE_AND_MOUNT; + /* * The name of transport file share resource group. This should be pre created by the customer. The app rg is used * in case of missing input. */ - @JsonProperty(value = "resourceGroup") private String resourceGroup; /* * The name of file share storage account name . A custom name is used in case of missing input. */ - @JsonProperty(value = "storageAccountName") private String storageAccountName; - /** Creates an instance of CreateAndMountFileShareConfiguration class. */ + /** + * Creates an instance of CreateAndMountFileShareConfiguration class. + */ public CreateAndMountFileShareConfiguration() { } + /** + * Get the configurationType property: The type of file share config. + * + * @return the configurationType value. + */ + @Override + public ConfigurationType configurationType() { + return this.configurationType; + } + /** * Get the resourceGroup property: The name of transport file share resource group. This should be pre created by * the customer. The app rg is used in case of missing input. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -48,7 +62,7 @@ public String resourceGroup() { /** * Set the resourceGroup property: The name of transport file share resource group. This should be pre created by * the customer. The app rg is used in case of missing input. - * + * * @param resourceGroup the resourceGroup value to set. * @return the CreateAndMountFileShareConfiguration object itself. */ @@ -60,7 +74,7 @@ public CreateAndMountFileShareConfiguration withResourceGroup(String resourceGro /** * Get the storageAccountName property: The name of file share storage account name . A custom name is used in case * of missing input. - * + * * @return the storageAccountName value. */ public String storageAccountName() { @@ -70,7 +84,7 @@ public String storageAccountName() { /** * Set the storageAccountName property: The name of file share storage account name . A custom name is used in case * of missing input. - * + * * @param storageAccountName the storageAccountName value to set. * @return the CreateAndMountFileShareConfiguration object itself. */ @@ -81,11 +95,56 @@ public CreateAndMountFileShareConfiguration withStorageAccountName(String storag /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateAndMountFileShareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateAndMountFileShareConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateAndMountFileShareConfiguration. + */ + public static CreateAndMountFileShareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateAndMountFileShareConfiguration deserializedCreateAndMountFileShareConfiguration + = new CreateAndMountFileShareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedCreateAndMountFileShareConfiguration.configurationType + = ConfigurationType.fromString(reader.getString()); + } else if ("resourceGroup".equals(fieldName)) { + deserializedCreateAndMountFileShareConfiguration.resourceGroup = reader.getString(); + } else if ("storageAccountName".equals(fieldName)) { + deserializedCreateAndMountFileShareConfiguration.storageAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateAndMountFileShareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DB2ProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DB2ProviderInstanceProperties.java index 699a2d830497..dcc16cb12a41 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DB2ProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DB2ProviderInstanceProperties.java @@ -5,76 +5,85 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the DB2 provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("Db2") +/** + * Gets or sets the DB2 provider properties. + */ @Fluent public final class DB2ProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "Db2"; + /* * Gets or sets the target virtual machine name. */ - @JsonProperty(value = "hostname") private String hostname; /* * Gets or sets the db2 database name. */ - @JsonProperty(value = "dbName") private String dbName; /* * Gets or sets the db2 database sql port. */ - @JsonProperty(value = "dbPort") private String dbPort; /* * Gets or sets the db2 database user name. */ - @JsonProperty(value = "dbUsername") private String dbUsername; /* * Gets or sets the db2 database password. */ - @JsonProperty(value = "dbPassword") private String dbPassword; /* * Gets or sets the key vault URI to secret with the database password. */ - @JsonProperty(value = "dbPasswordUri") private String dbPasswordUri; /* * Gets or sets the SAP System Identifier */ - @JsonProperty(value = "sapSid") private String sapSid; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; /* * Gets or sets the blob URI to SSL certificate for the DB2 Database. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; - /** Creates an instance of DB2ProviderInstanceProperties class. */ + /** + * Creates an instance of DB2ProviderInstanceProperties class. + */ public DB2ProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the hostname property: Gets or sets the target virtual machine name. - * + * * @return the hostname value. */ public String hostname() { @@ -83,7 +92,7 @@ public String hostname() { /** * Set the hostname property: Gets or sets the target virtual machine name. - * + * * @param hostname the hostname value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -94,7 +103,7 @@ public DB2ProviderInstanceProperties withHostname(String hostname) { /** * Get the dbName property: Gets or sets the db2 database name. - * + * * @return the dbName value. */ public String dbName() { @@ -103,7 +112,7 @@ public String dbName() { /** * Set the dbName property: Gets or sets the db2 database name. - * + * * @param dbName the dbName value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -114,7 +123,7 @@ public DB2ProviderInstanceProperties withDbName(String dbName) { /** * Get the dbPort property: Gets or sets the db2 database sql port. - * + * * @return the dbPort value. */ public String dbPort() { @@ -123,7 +132,7 @@ public String dbPort() { /** * Set the dbPort property: Gets or sets the db2 database sql port. - * + * * @param dbPort the dbPort value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -134,7 +143,7 @@ public DB2ProviderInstanceProperties withDbPort(String dbPort) { /** * Get the dbUsername property: Gets or sets the db2 database user name. - * + * * @return the dbUsername value. */ public String dbUsername() { @@ -143,7 +152,7 @@ public String dbUsername() { /** * Set the dbUsername property: Gets or sets the db2 database user name. - * + * * @param dbUsername the dbUsername value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -154,7 +163,7 @@ public DB2ProviderInstanceProperties withDbUsername(String dbUsername) { /** * Get the dbPassword property: Gets or sets the db2 database password. - * + * * @return the dbPassword value. */ public String dbPassword() { @@ -163,7 +172,7 @@ public String dbPassword() { /** * Set the dbPassword property: Gets or sets the db2 database password. - * + * * @param dbPassword the dbPassword value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -174,7 +183,7 @@ public DB2ProviderInstanceProperties withDbPassword(String dbPassword) { /** * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @return the dbPasswordUri value. */ public String dbPasswordUri() { @@ -183,7 +192,7 @@ public String dbPasswordUri() { /** * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @param dbPasswordUri the dbPasswordUri value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -194,7 +203,7 @@ public DB2ProviderInstanceProperties withDbPasswordUri(String dbPasswordUri) { /** * Get the sapSid property: Gets or sets the SAP System Identifier. - * + * * @return the sapSid value. */ public String sapSid() { @@ -203,7 +212,7 @@ public String sapSid() { /** * Set the sapSid property: Gets or sets the SAP System Identifier. - * + * * @param sapSid the sapSid value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -214,7 +223,7 @@ public DB2ProviderInstanceProperties withSapSid(String sapSid) { /** * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @return the sslPreference value. */ public SslPreference sslPreference() { @@ -223,7 +232,7 @@ public SslPreference sslPreference() { /** * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @param sslPreference the sslPreference value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -234,7 +243,7 @@ public DB2ProviderInstanceProperties withSslPreference(SslPreference sslPreferen /** * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB2 Database. - * + * * @return the sslCertificateUri value. */ public String sslCertificateUri() { @@ -243,7 +252,7 @@ public String sslCertificateUri() { /** * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB2 Database. - * + * * @param sslCertificateUri the sslCertificateUri value to set. * @return the DB2ProviderInstanceProperties object itself. */ @@ -254,11 +263,76 @@ public DB2ProviderInstanceProperties withSslCertificateUri(String sslCertificate /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("dbName", this.dbName); + jsonWriter.writeStringField("dbPort", this.dbPort); + jsonWriter.writeStringField("dbUsername", this.dbUsername); + jsonWriter.writeStringField("dbPassword", this.dbPassword); + jsonWriter.writeStringField("dbPasswordUri", this.dbPasswordUri); + jsonWriter.writeStringField("sapSid", this.sapSid); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DB2ProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DB2ProviderInstanceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DB2ProviderInstanceProperties. + */ + public static DB2ProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DB2ProviderInstanceProperties deserializedDB2ProviderInstanceProperties + = new DB2ProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.providerType = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.hostname = reader.getString(); + } else if ("dbName".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.dbName = reader.getString(); + } else if ("dbPort".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.dbPort = reader.getString(); + } else if ("dbUsername".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.dbUsername = reader.getString(); + } else if ("dbPassword".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.dbPassword = reader.getString(); + } else if ("dbPasswordUri".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.dbPasswordUri = reader.getString(); + } else if ("sapSid".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.sapSid = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedDB2ProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDB2ProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseConfiguration.java index f3b2faca3890..4877315a5873 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseConfiguration.java @@ -6,48 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Gets or sets the database configuration. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the database configuration. + */ @Fluent -public final class DatabaseConfiguration { +public final class DatabaseConfiguration implements JsonSerializable { /* * The database type. */ - @JsonProperty(value = "databaseType") private SapDatabaseType databaseType; /* * The subnet id. */ - @JsonProperty(value = "subnetId", required = true) private String subnetId; /* * Gets or sets the virtual machine configuration. */ - @JsonProperty(value = "virtualMachineConfiguration", required = true) private VirtualMachineConfiguration virtualMachineConfiguration; /* * The number of database VMs. */ - @JsonProperty(value = "instanceCount", required = true) private long instanceCount; /* * Gets or sets the disk configuration. */ - @JsonProperty(value = "diskConfiguration") private DiskConfiguration diskConfiguration; - /** Creates an instance of DatabaseConfiguration class. */ + /** + * Creates an instance of DatabaseConfiguration class. + */ public DatabaseConfiguration() { } /** * Get the databaseType property: The database type. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -56,7 +59,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. - * + * * @param databaseType the databaseType value to set. * @return the DatabaseConfiguration object itself. */ @@ -67,7 +70,7 @@ public DatabaseConfiguration withDatabaseType(SapDatabaseType databaseType) { /** * Get the subnetId property: The subnet id. - * + * * @return the subnetId value. */ public String subnetId() { @@ -76,7 +79,7 @@ public String subnetId() { /** * Set the subnetId property: The subnet id. - * + * * @param subnetId the subnetId value to set. * @return the DatabaseConfiguration object itself. */ @@ -87,7 +90,7 @@ public DatabaseConfiguration withSubnetId(String subnetId) { /** * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @return the virtualMachineConfiguration value. */ public VirtualMachineConfiguration virtualMachineConfiguration() { @@ -96,19 +99,19 @@ public VirtualMachineConfiguration virtualMachineConfiguration() { /** * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. * @return the DatabaseConfiguration object itself. */ - public DatabaseConfiguration withVirtualMachineConfiguration( - VirtualMachineConfiguration virtualMachineConfiguration) { + public DatabaseConfiguration + withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { this.virtualMachineConfiguration = virtualMachineConfiguration; return this; } /** * Get the instanceCount property: The number of database VMs. - * + * * @return the instanceCount value. */ public long instanceCount() { @@ -117,7 +120,7 @@ public long instanceCount() { /** * Set the instanceCount property: The number of database VMs. - * + * * @param instanceCount the instanceCount value to set. * @return the DatabaseConfiguration object itself. */ @@ -128,7 +131,7 @@ public DatabaseConfiguration withInstanceCount(long instanceCount) { /** * Get the diskConfiguration property: Gets or sets the disk configuration. - * + * * @return the diskConfiguration value. */ public DiskConfiguration diskConfiguration() { @@ -137,7 +140,7 @@ public DiskConfiguration diskConfiguration() { /** * Set the diskConfiguration property: Gets or sets the disk configuration. - * + * * @param diskConfiguration the diskConfiguration value to set. * @return the DatabaseConfiguration object itself. */ @@ -148,20 +151,18 @@ public DatabaseConfiguration withDiskConfiguration(DiskConfiguration diskConfigu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (subnetId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property subnetId in model DatabaseConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property subnetId in model DatabaseConfiguration")); } if (virtualMachineConfiguration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachineConfiguration in model DatabaseConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model DatabaseConfiguration")); } else { virtualMachineConfiguration().validate(); } @@ -171,4 +172,54 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(DatabaseConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeLongField("instanceCount", this.instanceCount); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + jsonWriter.writeJsonField("diskConfiguration", this.diskConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseConfiguration. + */ + public static DatabaseConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseConfiguration deserializedDatabaseConfiguration = new DatabaseConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedDatabaseConfiguration.subnetId = reader.getString(); + } else if ("virtualMachineConfiguration".equals(fieldName)) { + deserializedDatabaseConfiguration.virtualMachineConfiguration + = VirtualMachineConfiguration.fromJson(reader); + } else if ("instanceCount".equals(fieldName)) { + deserializedDatabaseConfiguration.instanceCount = reader.getLong(); + } else if ("databaseType".equals(fieldName)) { + deserializedDatabaseConfiguration.databaseType = SapDatabaseType.fromString(reader.getString()); + } else if ("diskConfiguration".equals(fieldName)) { + deserializedDatabaseConfiguration.diskConfiguration = DiskConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseServerFullResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseServerFullResourceNames.java index 9b19f8d657f2..baa488d1fed2 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseServerFullResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseServerFullResourceNames.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,32 +17,31 @@ * the number VMs to be created for database layer. */ @Fluent -public final class DatabaseServerFullResourceNames { +public final class DatabaseServerFullResourceNames implements JsonSerializable { /* * The list of virtual machine naming details. */ - @JsonProperty(value = "virtualMachines") private List virtualMachines; /* * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. */ - @JsonProperty(value = "availabilitySetName") private String availabilitySetName; /* * The resource names object for load balancer and related resources. */ - @JsonProperty(value = "loadBalancer") private LoadBalancerResourceNames loadBalancer; - /** Creates an instance of DatabaseServerFullResourceNames class. */ + /** + * Creates an instance of DatabaseServerFullResourceNames class. + */ public DatabaseServerFullResourceNames() { } /** * Get the virtualMachines property: The list of virtual machine naming details. - * + * * @return the virtualMachines value. */ public List virtualMachines() { @@ -47,7 +50,7 @@ public List virtualMachines() { /** * Set the virtualMachines property: The list of virtual machine naming details. - * + * * @param virtualMachines the virtualMachines value to set. * @return the DatabaseServerFullResourceNames object itself. */ @@ -59,7 +62,7 @@ public DatabaseServerFullResourceNames withVirtualMachines(List writer.writeJson(element)); + jsonWriter.writeStringField("availabilitySetName", this.availabilitySetName); + jsonWriter.writeJsonField("loadBalancer", this.loadBalancer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseServerFullResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseServerFullResourceNames if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseServerFullResourceNames. + */ + public static DatabaseServerFullResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseServerFullResourceNames deserializedDatabaseServerFullResourceNames + = new DatabaseServerFullResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachines".equals(fieldName)) { + List virtualMachines + = reader.readArray(reader1 -> VirtualMachineResourceNames.fromJson(reader1)); + deserializedDatabaseServerFullResourceNames.virtualMachines = virtualMachines; + } else if ("availabilitySetName".equals(fieldName)) { + deserializedDatabaseServerFullResourceNames.availabilitySetName = reader.getString(); + } else if ("loadBalancer".equals(fieldName)) { + deserializedDatabaseServerFullResourceNames.loadBalancer + = LoadBalancerResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseServerFullResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseVmDetails.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseVmDetails.java index 0002109d1ccd..86a888d42a18 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseVmDetails.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseVmDetails.java @@ -5,38 +5,43 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Database VM details. */ +/** + * Database VM details. + */ @Immutable -public final class DatabaseVmDetails { +public final class DatabaseVmDetails implements JsonSerializable { /* * The virtualMachineId property. */ - @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) private String virtualMachineId; /* * Defines the SAP Instance status. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private SapVirtualInstanceStatus status; /* * Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared * Storage. */ - @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) private List storageDetails; - /** Creates an instance of DatabaseVmDetails class. */ + /** + * Creates an instance of DatabaseVmDetails class. + */ public DatabaseVmDetails() { } /** * Get the virtualMachineId property: The virtualMachineId property. - * + * * @return the virtualMachineId value. */ public String virtualMachineId() { @@ -45,7 +50,7 @@ public String virtualMachineId() { /** * Get the status property: Defines the SAP Instance status. - * + * * @return the status value. */ public SapVirtualInstanceStatus status() { @@ -55,7 +60,7 @@ public SapVirtualInstanceStatus status() { /** * Get the storageDetails property: Storage details of all the Storage Accounts attached to the Database Virtual * Machine. For e.g. NFS on AFS Shared Storage. - * + * * @return the storageDetails value. */ public List storageDetails() { @@ -64,7 +69,7 @@ public List storageDetails() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -72,4 +77,45 @@ public void validate() { storageDetails().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseVmDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseVmDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseVmDetails. + */ + public static DatabaseVmDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseVmDetails deserializedDatabaseVmDetails = new DatabaseVmDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachineId".equals(fieldName)) { + deserializedDatabaseVmDetails.virtualMachineId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDatabaseVmDetails.status = SapVirtualInstanceStatus.fromString(reader.getString()); + } else if ("storageDetails".equals(fieldName)) { + List storageDetails + = reader.readArray(reader1 -> StorageInformation.fromJson(reader1)); + deserializedDatabaseVmDetails.storageDetails = storageDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseVmDetails; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeployerVmPackages.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeployerVmPackages.java index 97737982788d..d2f6026251dd 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeployerVmPackages.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeployerVmPackages.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the url and storage account ID where deployer VM packages are uploaded. */ +/** + * Defines the url and storage account ID where deployer VM packages are uploaded. + */ @Fluent -public final class DeployerVmPackages { +public final class DeployerVmPackages implements JsonSerializable { /* * The URL to the deployer VM packages file. */ - @JsonProperty(value = "url") private String url; /* * The deployer VM packages storage account id */ - @JsonProperty(value = "storageAccountId") private String storageAccountId; - /** Creates an instance of DeployerVmPackages class. */ + /** + * Creates an instance of DeployerVmPackages class. + */ public DeployerVmPackages() { } /** * Get the url property: The URL to the deployer VM packages file. - * + * * @return the url value. */ public String url() { @@ -37,7 +43,7 @@ public String url() { /** * Set the url property: The URL to the deployer VM packages file. - * + * * @param url the url value to set. * @return the DeployerVmPackages object itself. */ @@ -48,7 +54,7 @@ public DeployerVmPackages withUrl(String url) { /** * Get the storageAccountId property: The deployer VM packages storage account id. - * + * * @return the storageAccountId value. */ public String storageAccountId() { @@ -57,7 +63,7 @@ public String storageAccountId() { /** * Set the storageAccountId property: The deployer VM packages storage account id. - * + * * @param storageAccountId the storageAccountId value to set. * @return the DeployerVmPackages object itself. */ @@ -68,9 +74,48 @@ public DeployerVmPackages withStorageAccountId(String storageAccountId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("storageAccountId", this.storageAccountId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeployerVmPackages from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeployerVmPackages if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeployerVmPackages. + */ + public static DeployerVmPackages fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeployerVmPackages deserializedDeployerVmPackages = new DeployerVmPackages(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedDeployerVmPackages.url = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedDeployerVmPackages.storageAccountId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeployerVmPackages; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentConfiguration.java index ee75617f5df4..72ec44a89a71 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentConfiguration.java @@ -5,40 +5,55 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Deployment Configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("Deployment") +/** + * Deployment Configuration. + */ @Fluent public final class DeploymentConfiguration extends SapConfiguration { + /* + * The configuration Type. + */ + private SapConfigurationType configurationType = SapConfigurationType.DEPLOYMENT; + /* * The geo-location where the SAP system is to be created. */ - @JsonProperty(value = "appLocation") private String appLocation; /* * The infrastructure configuration. */ - @JsonProperty(value = "infrastructureConfiguration") private InfrastructureConfiguration infrastructureConfiguration; /* * The software configuration. */ - @JsonProperty(value = "softwareConfiguration") private SoftwareConfiguration softwareConfiguration; - /** Creates an instance of DeploymentConfiguration class. */ + /** + * Creates an instance of DeploymentConfiguration class. + */ public DeploymentConfiguration() { } + /** + * Get the configurationType property: The configuration Type. + * + * @return the configurationType value. + */ + @Override + public SapConfigurationType configurationType() { + return this.configurationType; + } + /** * Get the appLocation property: The geo-location where the SAP system is to be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -47,7 +62,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the SAP system is to be created. - * + * * @param appLocation the appLocation value to set. * @return the DeploymentConfiguration object itself. */ @@ -58,7 +73,7 @@ public DeploymentConfiguration withAppLocation(String appLocation) { /** * Get the infrastructureConfiguration property: The infrastructure configuration. - * + * * @return the infrastructureConfiguration value. */ public InfrastructureConfiguration infrastructureConfiguration() { @@ -67,19 +82,19 @@ public InfrastructureConfiguration infrastructureConfiguration() { /** * Set the infrastructureConfiguration property: The infrastructure configuration. - * + * * @param infrastructureConfiguration the infrastructureConfiguration value to set. * @return the DeploymentConfiguration object itself. */ - public DeploymentConfiguration withInfrastructureConfiguration( - InfrastructureConfiguration infrastructureConfiguration) { + public DeploymentConfiguration + withInfrastructureConfiguration(InfrastructureConfiguration infrastructureConfiguration) { this.infrastructureConfiguration = infrastructureConfiguration; return this; } /** * Get the softwareConfiguration property: The software configuration. - * + * * @return the softwareConfiguration value. */ public SoftwareConfiguration softwareConfiguration() { @@ -88,7 +103,7 @@ public SoftwareConfiguration softwareConfiguration() { /** * Set the softwareConfiguration property: The software configuration. - * + * * @param softwareConfiguration the softwareConfiguration value to set. * @return the DeploymentConfiguration object itself. */ @@ -99,7 +114,7 @@ public DeploymentConfiguration withSoftwareConfiguration(SoftwareConfiguration s /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -112,4 +127,52 @@ public void validate() { softwareConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeJsonField("infrastructureConfiguration", this.infrastructureConfiguration); + jsonWriter.writeJsonField("softwareConfiguration", this.softwareConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentConfiguration. + */ + public static DeploymentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentConfiguration deserializedDeploymentConfiguration = new DeploymentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedDeploymentConfiguration.configurationType + = SapConfigurationType.fromString(reader.getString()); + } else if ("appLocation".equals(fieldName)) { + deserializedDeploymentConfiguration.appLocation = reader.getString(); + } else if ("infrastructureConfiguration".equals(fieldName)) { + deserializedDeploymentConfiguration.infrastructureConfiguration + = InfrastructureConfiguration.fromJson(reader); + } else if ("softwareConfiguration".equals(fieldName)) { + deserializedDeploymentConfiguration.softwareConfiguration = SoftwareConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentWithOSConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentWithOSConfiguration.java index a2099837a6d6..56f34953444c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentWithOSConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentWithOSConfiguration.java @@ -5,46 +5,60 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Deployment along with OS Configuration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("DeploymentWithOSConfig") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Deployment along with OS Configuration. + */ @Fluent public final class DeploymentWithOSConfiguration extends SapConfiguration { + /* + * The configuration Type. + */ + private SapConfigurationType configurationType = SapConfigurationType.DEPLOYMENT_WITH_OSCONFIG; + /* * The geo-location where the SAP system is to be created. */ - @JsonProperty(value = "appLocation") private String appLocation; /* * The infrastructure configuration. */ - @JsonProperty(value = "infrastructureConfiguration") private InfrastructureConfiguration infrastructureConfiguration; /* * The software configuration. */ - @JsonProperty(value = "softwareConfiguration") private SoftwareConfiguration softwareConfiguration; /* * The OS and SAP configuration. */ - @JsonProperty(value = "osSapConfiguration") private OsSapConfiguration osSapConfiguration; - /** Creates an instance of DeploymentWithOSConfiguration class. */ + /** + * Creates an instance of DeploymentWithOSConfiguration class. + */ public DeploymentWithOSConfiguration() { } + /** + * Get the configurationType property: The configuration Type. + * + * @return the configurationType value. + */ + @Override + public SapConfigurationType configurationType() { + return this.configurationType; + } + /** * Get the appLocation property: The geo-location where the SAP system is to be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -53,7 +67,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the SAP system is to be created. - * + * * @param appLocation the appLocation value to set. * @return the DeploymentWithOSConfiguration object itself. */ @@ -64,7 +78,7 @@ public DeploymentWithOSConfiguration withAppLocation(String appLocation) { /** * Get the infrastructureConfiguration property: The infrastructure configuration. - * + * * @return the infrastructureConfiguration value. */ public InfrastructureConfiguration infrastructureConfiguration() { @@ -73,19 +87,19 @@ public InfrastructureConfiguration infrastructureConfiguration() { /** * Set the infrastructureConfiguration property: The infrastructure configuration. - * + * * @param infrastructureConfiguration the infrastructureConfiguration value to set. * @return the DeploymentWithOSConfiguration object itself. */ - public DeploymentWithOSConfiguration withInfrastructureConfiguration( - InfrastructureConfiguration infrastructureConfiguration) { + public DeploymentWithOSConfiguration + withInfrastructureConfiguration(InfrastructureConfiguration infrastructureConfiguration) { this.infrastructureConfiguration = infrastructureConfiguration; return this; } /** * Get the softwareConfiguration property: The software configuration. - * + * * @return the softwareConfiguration value. */ public SoftwareConfiguration softwareConfiguration() { @@ -94,7 +108,7 @@ public SoftwareConfiguration softwareConfiguration() { /** * Set the softwareConfiguration property: The software configuration. - * + * * @param softwareConfiguration the softwareConfiguration value to set. * @return the DeploymentWithOSConfiguration object itself. */ @@ -105,7 +119,7 @@ public DeploymentWithOSConfiguration withSoftwareConfiguration(SoftwareConfigura /** * Get the osSapConfiguration property: The OS and SAP configuration. - * + * * @return the osSapConfiguration value. */ public OsSapConfiguration osSapConfiguration() { @@ -114,7 +128,7 @@ public OsSapConfiguration osSapConfiguration() { /** * Set the osSapConfiguration property: The OS and SAP configuration. - * + * * @param osSapConfiguration the osSapConfiguration value to set. * @return the DeploymentWithOSConfiguration object itself. */ @@ -125,7 +139,7 @@ public DeploymentWithOSConfiguration withOsSapConfiguration(OsSapConfiguration o /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -141,4 +155,57 @@ public void validate() { osSapConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeJsonField("infrastructureConfiguration", this.infrastructureConfiguration); + jsonWriter.writeJsonField("softwareConfiguration", this.softwareConfiguration); + jsonWriter.writeJsonField("osSapConfiguration", this.osSapConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentWithOSConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentWithOSConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentWithOSConfiguration. + */ + public static DeploymentWithOSConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentWithOSConfiguration deserializedDeploymentWithOSConfiguration + = new DeploymentWithOSConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedDeploymentWithOSConfiguration.configurationType + = SapConfigurationType.fromString(reader.getString()); + } else if ("appLocation".equals(fieldName)) { + deserializedDeploymentWithOSConfiguration.appLocation = reader.getString(); + } else if ("infrastructureConfiguration".equals(fieldName)) { + deserializedDeploymentWithOSConfiguration.infrastructureConfiguration + = InfrastructureConfiguration.fromJson(reader); + } else if ("softwareConfiguration".equals(fieldName)) { + deserializedDeploymentWithOSConfiguration.softwareConfiguration + = SoftwareConfiguration.fromJson(reader); + } else if ("osSapConfiguration".equals(fieldName)) { + deserializedDeploymentWithOSConfiguration.osSapConfiguration = OsSapConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentWithOSConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiscoveryConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiscoveryConfiguration.java index 5214a804c485..c9b107fbe141 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiscoveryConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiscoveryConfiguration.java @@ -5,43 +5,58 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Discovery Details. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("Discovery") +/** + * Discovery Details. + */ @Fluent public final class DiscoveryConfiguration extends SapConfiguration { + /* + * The configuration Type. + */ + private SapConfigurationType configurationType = SapConfigurationType.DISCOVERY; + /* * The virtual machine ID of the Central Server. */ - @JsonProperty(value = "centralServerVmId") private String centralServerVmId; /* * The custom storage account name for the storage account created by the service in the managed resource group * created as part of VIS deployment.

Refer to the storage account naming rules - * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).

If - * not provided, the service will create the storage account with a random name. + * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage). + *

If not provided, the service will create the storage account with a random name. */ - @JsonProperty(value = "managedRgStorageAccountName") private String managedRgStorageAccountName; /* * The geo-location where the SAP system exists. */ - @JsonProperty(value = "appLocation", access = JsonProperty.Access.WRITE_ONLY) private String appLocation; - /** Creates an instance of DiscoveryConfiguration class. */ + /** + * Creates an instance of DiscoveryConfiguration class. + */ public DiscoveryConfiguration() { } + /** + * Get the configurationType property: The configuration Type. + * + * @return the configurationType value. + */ + @Override + public SapConfigurationType configurationType() { + return this.configurationType; + } + /** * Get the centralServerVmId property: The virtual machine ID of the Central Server. - * + * * @return the centralServerVmId value. */ public String centralServerVmId() { @@ -50,7 +65,7 @@ public String centralServerVmId() { /** * Set the centralServerVmId property: The virtual machine ID of the Central Server. - * + * * @param centralServerVmId the centralServerVmId value to set. * @return the DiscoveryConfiguration object itself. */ @@ -65,7 +80,7 @@ public DiscoveryConfiguration withCentralServerVmId(String centralServerVmId) { * storage account naming rules * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If * not provided, the service will create the storage account with a random name. - * + * * @return the managedRgStorageAccountName value. */ public String managedRgStorageAccountName() { @@ -78,7 +93,7 @@ public String managedRgStorageAccountName() { * storage account naming rules * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If * not provided, the service will create the storage account with a random name. - * + * * @param managedRgStorageAccountName the managedRgStorageAccountName value to set. * @return the DiscoveryConfiguration object itself. */ @@ -89,7 +104,7 @@ public DiscoveryConfiguration withManagedRgStorageAccountName(String managedRgSt /** * Get the appLocation property: The geo-location where the SAP system exists. - * + * * @return the appLocation value. */ public String appLocation() { @@ -98,11 +113,57 @@ public String appLocation() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + jsonWriter.writeStringField("centralServerVmId", this.centralServerVmId); + jsonWriter.writeStringField("managedRgStorageAccountName", this.managedRgStorageAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiscoveryConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiscoveryConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiscoveryConfiguration. + */ + public static DiscoveryConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiscoveryConfiguration deserializedDiscoveryConfiguration = new DiscoveryConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedDiscoveryConfiguration.configurationType + = SapConfigurationType.fromString(reader.getString()); + } else if ("centralServerVmId".equals(fieldName)) { + deserializedDiscoveryConfiguration.centralServerVmId = reader.getString(); + } else if ("managedRgStorageAccountName".equals(fieldName)) { + deserializedDiscoveryConfiguration.managedRgStorageAccountName = reader.getString(); + } else if ("appLocation".equals(fieldName)) { + deserializedDiscoveryConfiguration.appLocation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiscoveryConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskConfiguration.java index 8497c9e0908a..16d3f76263cf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskConfiguration.java @@ -5,29 +5,34 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** The Disk Configuration Details. */ +/** + * The Disk Configuration Details. + */ @Fluent -public final class DiskConfiguration { +public final class DiskConfiguration implements JsonSerializable { /* - * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', - * hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', + * 'usr/sap', 'os'], Optional volume : ['backup']. */ - @JsonProperty(value = "diskVolumeConfigurations") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map diskVolumeConfigurations; - /** Creates an instance of DiskConfiguration class. */ + /** + * Creates an instance of DiskConfiguration class. + */ public DiskConfiguration() { } /** * Get the diskVolumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes * are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. - * + * * @return the diskVolumeConfigurations value. */ public Map diskVolumeConfigurations() { @@ -37,31 +42,67 @@ public Map diskVolumeConfigurations() { /** * Set the diskVolumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes * are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. - * + * * @param diskVolumeConfigurations the diskVolumeConfigurations value to set. * @return the DiskConfiguration object itself. */ - public DiskConfiguration withDiskVolumeConfigurations( - Map diskVolumeConfigurations) { + public DiskConfiguration + withDiskVolumeConfigurations(Map diskVolumeConfigurations) { this.diskVolumeConfigurations = diskVolumeConfigurations; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (diskVolumeConfigurations() != null) { - diskVolumeConfigurations() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + diskVolumeConfigurations().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("diskVolumeConfigurations", this.diskVolumeConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskConfiguration. + */ + public static DiskConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskConfiguration deserializedDiskConfiguration = new DiskConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("diskVolumeConfigurations".equals(fieldName)) { + Map diskVolumeConfigurations + = reader.readMap(reader1 -> DiskVolumeConfiguration.fromJson(reader1)); + deserializedDiskConfiguration.diskVolumeConfigurations = diskVolumeConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedDiskConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskDetails.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskDetails.java index ecfb8788066c..92dd059b684a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskDetails.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskDetails.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The supported disk size details for a disk type. */ +/** + * The supported disk size details for a disk type. + */ @Fluent -public final class DiskDetails { +public final class DiskDetails implements JsonSerializable { /* * The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. */ - @JsonProperty(value = "sku") private DiskSku sku; /* * The disk size in GB. */ - @JsonProperty(value = "sizeGB") private Long sizeGB; /* * The minimum supported disk count. */ - @JsonProperty(value = "minimumSupportedDiskCount") private Long minimumSupportedDiskCount; /* * The maximum supported disk count. */ - @JsonProperty(value = "maximumSupportedDiskCount") private Long maximumSupportedDiskCount; /* * The disk Iops. */ - @JsonProperty(value = "iopsReadWrite") private Long iopsReadWrite; /* * The disk provisioned throughput in MBps. */ - @JsonProperty(value = "mbpsReadWrite") private Long mbpsReadWrite; /* * The disk tier, e.g. P10, E10. */ - @JsonProperty(value = "diskTier") private String diskTier; - /** Creates an instance of DiskDetails class. */ + /** + * Creates an instance of DiskDetails class. + */ public DiskDetails() { } /** * Get the sku property: The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. - * + * * @return the sku value. */ public DiskSku sku() { @@ -67,7 +68,7 @@ public DiskSku sku() { /** * Set the sku property: The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. - * + * * @param sku the sku value to set. * @return the DiskDetails object itself. */ @@ -78,7 +79,7 @@ public DiskDetails withSku(DiskSku sku) { /** * Get the sizeGB property: The disk size in GB. - * + * * @return the sizeGB value. */ public Long sizeGB() { @@ -87,7 +88,7 @@ public Long sizeGB() { /** * Set the sizeGB property: The disk size in GB. - * + * * @param sizeGB the sizeGB value to set. * @return the DiskDetails object itself. */ @@ -98,7 +99,7 @@ public DiskDetails withSizeGB(Long sizeGB) { /** * Get the minimumSupportedDiskCount property: The minimum supported disk count. - * + * * @return the minimumSupportedDiskCount value. */ public Long minimumSupportedDiskCount() { @@ -107,7 +108,7 @@ public Long minimumSupportedDiskCount() { /** * Set the minimumSupportedDiskCount property: The minimum supported disk count. - * + * * @param minimumSupportedDiskCount the minimumSupportedDiskCount value to set. * @return the DiskDetails object itself. */ @@ -118,7 +119,7 @@ public DiskDetails withMinimumSupportedDiskCount(Long minimumSupportedDiskCount) /** * Get the maximumSupportedDiskCount property: The maximum supported disk count. - * + * * @return the maximumSupportedDiskCount value. */ public Long maximumSupportedDiskCount() { @@ -127,7 +128,7 @@ public Long maximumSupportedDiskCount() { /** * Set the maximumSupportedDiskCount property: The maximum supported disk count. - * + * * @param maximumSupportedDiskCount the maximumSupportedDiskCount value to set. * @return the DiskDetails object itself. */ @@ -138,7 +139,7 @@ public DiskDetails withMaximumSupportedDiskCount(Long maximumSupportedDiskCount) /** * Get the iopsReadWrite property: The disk Iops. - * + * * @return the iopsReadWrite value. */ public Long iopsReadWrite() { @@ -147,7 +148,7 @@ public Long iopsReadWrite() { /** * Set the iopsReadWrite property: The disk Iops. - * + * * @param iopsReadWrite the iopsReadWrite value to set. * @return the DiskDetails object itself. */ @@ -158,7 +159,7 @@ public DiskDetails withIopsReadWrite(Long iopsReadWrite) { /** * Get the mbpsReadWrite property: The disk provisioned throughput in MBps. - * + * * @return the mbpsReadWrite value. */ public Long mbpsReadWrite() { @@ -167,7 +168,7 @@ public Long mbpsReadWrite() { /** * Set the mbpsReadWrite property: The disk provisioned throughput in MBps. - * + * * @param mbpsReadWrite the mbpsReadWrite value to set. * @return the DiskDetails object itself. */ @@ -178,7 +179,7 @@ public DiskDetails withMbpsReadWrite(Long mbpsReadWrite) { /** * Get the diskTier property: The disk tier, e.g. P10, E10. - * + * * @return the diskTier value. */ public String diskTier() { @@ -187,7 +188,7 @@ public String diskTier() { /** * Set the diskTier property: The disk tier, e.g. P10, E10. - * + * * @param diskTier the diskTier value to set. * @return the DiskDetails object itself. */ @@ -198,7 +199,7 @@ public DiskDetails withDiskTier(String diskTier) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -206,4 +207,58 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeNumberField("sizeGB", this.sizeGB); + jsonWriter.writeNumberField("minimumSupportedDiskCount", this.minimumSupportedDiskCount); + jsonWriter.writeNumberField("maximumSupportedDiskCount", this.maximumSupportedDiskCount); + jsonWriter.writeNumberField("iopsReadWrite", this.iopsReadWrite); + jsonWriter.writeNumberField("mbpsReadWrite", this.mbpsReadWrite); + jsonWriter.writeStringField("diskTier", this.diskTier); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskDetails. + */ + public static DiskDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskDetails deserializedDiskDetails = new DiskDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedDiskDetails.sku = DiskSku.fromJson(reader); + } else if ("sizeGB".equals(fieldName)) { + deserializedDiskDetails.sizeGB = reader.getNullable(JsonReader::getLong); + } else if ("minimumSupportedDiskCount".equals(fieldName)) { + deserializedDiskDetails.minimumSupportedDiskCount = reader.getNullable(JsonReader::getLong); + } else if ("maximumSupportedDiskCount".equals(fieldName)) { + deserializedDiskDetails.maximumSupportedDiskCount = reader.getNullable(JsonReader::getLong); + } else if ("iopsReadWrite".equals(fieldName)) { + deserializedDiskDetails.iopsReadWrite = reader.getNullable(JsonReader::getLong); + } else if ("mbpsReadWrite".equals(fieldName)) { + deserializedDiskDetails.mbpsReadWrite = reader.getNullable(JsonReader::getLong); + } else if ("diskTier".equals(fieldName)) { + deserializedDiskDetails.diskTier = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskDetails; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSku.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSku.java index 22a826ad757a..1b476c188207 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSku.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSku.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. */ +/** + * The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + */ @Fluent -public final class DiskSku { +public final class DiskSku implements JsonSerializable { /* * Defines the disk sku name. */ - @JsonProperty(value = "name") private DiskSkuName name; - /** Creates an instance of DiskSku class. */ + /** + * Creates an instance of DiskSku class. + */ public DiskSku() { } /** * Get the name property: Defines the disk sku name. - * + * * @return the name value. */ public DiskSkuName name() { @@ -31,7 +38,7 @@ public DiskSkuName name() { /** * Set the name property: Defines the disk sku name. - * + * * @param name the name value to set. * @return the DiskSku object itself. */ @@ -42,9 +49,45 @@ public DiskSku withName(DiskSkuName name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskSku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the DiskSku. + */ + public static DiskSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskSku deserializedDiskSku = new DiskSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDiskSku.name = DiskSkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskSku; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSkuName.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSkuName.java index a62ab7ed891d..00606ea7a384 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSkuName.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskSkuName.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the disk sku name. */ +/** + * Defines the disk sku name. + */ public final class DiskSkuName extends ExpandableStringEnum { - /** Static value Standard_LRS for DiskSkuName. */ + /** + * Static value Standard_LRS for DiskSkuName. + */ public static final DiskSkuName STANDARD_LRS = fromString("Standard_LRS"); - /** Static value Premium_LRS for DiskSkuName. */ + /** + * Static value Premium_LRS for DiskSkuName. + */ public static final DiskSkuName PREMIUM_LRS = fromString("Premium_LRS"); - /** Static value StandardSSD_LRS for DiskSkuName. */ + /** + * Static value StandardSSD_LRS for DiskSkuName. + */ public static final DiskSkuName STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); - /** Static value UltraSSD_LRS for DiskSkuName. */ + /** + * Static value UltraSSD_LRS for DiskSkuName. + */ public static final DiskSkuName ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); - /** Static value Premium_ZRS for DiskSkuName. */ + /** + * Static value Premium_ZRS for DiskSkuName. + */ public static final DiskSkuName PREMIUM_ZRS = fromString("Premium_ZRS"); - /** Static value StandardSSD_ZRS for DiskSkuName. */ + /** + * Static value StandardSSD_ZRS for DiskSkuName. + */ public static final DiskSkuName STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); - /** Static value PremiumV2_LRS for DiskSkuName. */ + /** + * Static value PremiumV2_LRS for DiskSkuName. + */ public static final DiskSkuName PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); /** * Creates a new instance of DiskSkuName value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public DiskSkuName() { /** * Creates or finds a DiskSkuName from its string representation. - * + * * @param name a name to look for. * @return the corresponding DiskSkuName. */ - @JsonCreator public static DiskSkuName fromString(String name) { return fromString(name, DiskSkuName.class); } /** * Gets known DiskSkuName values. - * + * * @return known DiskSkuName values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskVolumeConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskVolumeConfiguration.java index d31ec2ad12eb..d4f29741b2e9 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskVolumeConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskVolumeConfiguration.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The disk configuration required for the selected volume. */ +/** + * The disk configuration required for the selected volume. + */ @Fluent -public final class DiskVolumeConfiguration { +public final class DiskVolumeConfiguration implements JsonSerializable { /* * The total number of disks required for the concerned volume. */ - @JsonProperty(value = "count") private Long count; /* * The disk size in GB. */ - @JsonProperty(value = "sizeGB") private Long sizeGB; /* * The disk SKU details. */ - @JsonProperty(value = "sku") private DiskSku sku; - /** Creates an instance of DiskVolumeConfiguration class. */ + /** + * Creates an instance of DiskVolumeConfiguration class. + */ public DiskVolumeConfiguration() { } /** * Get the count property: The total number of disks required for the concerned volume. - * + * * @return the count value. */ public Long count() { @@ -43,7 +48,7 @@ public Long count() { /** * Set the count property: The total number of disks required for the concerned volume. - * + * * @param count the count value to set. * @return the DiskVolumeConfiguration object itself. */ @@ -54,7 +59,7 @@ public DiskVolumeConfiguration withCount(Long count) { /** * Get the sizeGB property: The disk size in GB. - * + * * @return the sizeGB value. */ public Long sizeGB() { @@ -63,7 +68,7 @@ public Long sizeGB() { /** * Set the sizeGB property: The disk size in GB. - * + * * @param sizeGB the sizeGB value to set. * @return the DiskVolumeConfiguration object itself. */ @@ -74,7 +79,7 @@ public DiskVolumeConfiguration withSizeGB(Long sizeGB) { /** * Get the sku property: The disk SKU details. - * + * * @return the sku value. */ public DiskSku sku() { @@ -83,7 +88,7 @@ public DiskSku sku() { /** * Set the sku property: The disk SKU details. - * + * * @param sku the sku value to set. * @return the DiskVolumeConfiguration object itself. */ @@ -94,7 +99,7 @@ public DiskVolumeConfiguration withSku(DiskSku sku) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -102,4 +107,46 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeNumberField("sizeGB", this.sizeGB); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiskVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiskVolumeConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiskVolumeConfiguration. + */ + public static DiskVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiskVolumeConfiguration deserializedDiskVolumeConfiguration = new DiskVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedDiskVolumeConfiguration.count = reader.getNullable(JsonReader::getLong); + } else if ("sizeGB".equals(fieldName)) { + deserializedDiskVolumeConfiguration.sizeGB = reader.getNullable(JsonReader::getLong); + } else if ("sku".equals(fieldName)) { + deserializedDiskVolumeConfiguration.sku = DiskSku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDiskVolumeConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerProperties.java index 3721846aac49..c86547c8d572 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerProperties.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the SAP Enqueue Replication Server (ERS) properties. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the SAP Enqueue Replication Server (ERS) properties. + */ @Immutable -public final class EnqueueReplicationServerProperties { +public final class EnqueueReplicationServerProperties implements JsonSerializable { /* * Defines the type of Enqueue Replication Server. */ - @JsonProperty(value = "ersVersion", access = JsonProperty.Access.WRITE_ONLY) private EnqueueReplicationServerType ersVersion; /* * ERS Instance Number. */ - @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) private String instanceNo; /* * ERS SAP Hostname. */ - @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * ERS SAP Kernel Version. */ - @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) private String kernelVersion; /* * ERS SAP Kernel Patch level. */ - @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) private String kernelPatch; /* * ERS SAP IP Address. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; - /** Creates an instance of EnqueueReplicationServerProperties class. */ + /** + * Creates an instance of EnqueueReplicationServerProperties class. + */ public EnqueueReplicationServerProperties() { } /** * Get the ersVersion property: Defines the type of Enqueue Replication Server. - * + * * @return the ersVersion value. */ public EnqueueReplicationServerType ersVersion() { @@ -67,7 +68,7 @@ public EnqueueReplicationServerType ersVersion() { /** * Get the instanceNo property: ERS Instance Number. - * + * * @return the instanceNo value. */ public String instanceNo() { @@ -76,7 +77,7 @@ public String instanceNo() { /** * Get the hostname property: ERS SAP Hostname. - * + * * @return the hostname value. */ public String hostname() { @@ -85,7 +86,7 @@ public String hostname() { /** * Get the kernelVersion property: ERS SAP Kernel Version. - * + * * @return the kernelVersion value. */ public String kernelVersion() { @@ -94,7 +95,7 @@ public String kernelVersion() { /** * Get the kernelPatch property: ERS SAP Kernel Patch level. - * + * * @return the kernelPatch value. */ public String kernelPatch() { @@ -103,7 +104,7 @@ public String kernelPatch() { /** * Get the ipAddress property: ERS SAP IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -112,7 +113,7 @@ public String ipAddress() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -121,9 +122,59 @@ public SapHealthState health() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnqueueReplicationServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnqueueReplicationServerProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnqueueReplicationServerProperties. + */ + public static EnqueueReplicationServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnqueueReplicationServerProperties deserializedEnqueueReplicationServerProperties + = new EnqueueReplicationServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ersVersion".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.ersVersion + = EnqueueReplicationServerType.fromString(reader.getString()); + } else if ("instanceNo".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.instanceNo = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.hostname = reader.getString(); + } else if ("kernelVersion".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.kernelVersion = reader.getString(); + } else if ("kernelPatch".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.kernelPatch = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.ipAddress = reader.getString(); + } else if ("health".equals(fieldName)) { + deserializedEnqueueReplicationServerProperties.health + = SapHealthState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEnqueueReplicationServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerType.java index 001aa57afd7e..0f1f330a7486 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the type of Enqueue Replication Server. */ +/** + * Defines the type of Enqueue Replication Server. + */ public final class EnqueueReplicationServerType extends ExpandableStringEnum { - /** Static value EnqueueReplicator1 for EnqueueReplicationServerType. */ + /** + * Static value EnqueueReplicator1 for EnqueueReplicationServerType. + */ public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR1 = fromString("EnqueueReplicator1"); - /** Static value EnqueueReplicator2 for EnqueueReplicationServerType. */ + /** + * Static value EnqueueReplicator2 for EnqueueReplicationServerType. + */ public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR2 = fromString("EnqueueReplicator2"); /** * Creates a new instance of EnqueueReplicationServerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public EnqueueReplicationServerType() { /** * Creates or finds a EnqueueReplicationServerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnqueueReplicationServerType. */ - @JsonCreator public static EnqueueReplicationServerType fromString(String name) { return fromString(name, EnqueueReplicationServerType.class); } /** * Gets known EnqueueReplicationServerType values. - * + * * @return known EnqueueReplicationServerType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueServerProperties.java index e61afd049343..cc122e066d8e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueServerProperties.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the SAP Enqueue Server properties. */ +/** + * Defines the SAP Enqueue Server properties. + */ @Immutable -public final class EnqueueServerProperties { +public final class EnqueueServerProperties implements JsonSerializable { /* * Enqueue Server SAP Hostname. */ - @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * Enqueue Server SAP IP Address. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * Enqueue Server Port. */ - @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) private Long port; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; - /** Creates an instance of EnqueueServerProperties class. */ + /** + * Creates an instance of EnqueueServerProperties class. + */ public EnqueueServerProperties() { } /** * Get the hostname property: Enqueue Server SAP Hostname. - * + * * @return the hostname value. */ public String hostname() { @@ -49,7 +53,7 @@ public String hostname() { /** * Get the ipAddress property: Enqueue Server SAP IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -58,7 +62,7 @@ public String ipAddress() { /** * Get the port property: Enqueue Server Port. - * + * * @return the port value. */ public Long port() { @@ -67,7 +71,7 @@ public Long port() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -76,9 +80,50 @@ public SapHealthState health() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnqueueServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnqueueServerProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnqueueServerProperties. + */ + public static EnqueueServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnqueueServerProperties deserializedEnqueueServerProperties = new EnqueueServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostname".equals(fieldName)) { + deserializedEnqueueServerProperties.hostname = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedEnqueueServerProperties.ipAddress = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEnqueueServerProperties.port = reader.getNullable(JsonReader::getLong); + } else if ("health".equals(fieldName)) { + deserializedEnqueueServerProperties.health = SapHealthState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEnqueueServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Error.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Error.java index 76ac3db4bb2e..55527ed0d337 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Error.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Error.java @@ -5,94 +5,152 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Standard error object. */ +/** + * Standard error object. + */ @Immutable -public class Error { +public class Error implements JsonSerializable { /* * Server-defined set of error codes. */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* * Human-readable representation of the error. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * Target of the error. */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) private String target; /* * Array of details about specific errors that led to this reported error. */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) private List details; /* - * Object containing more specific information than the current object about the error. + * Object containing more specific information than the current object about the error. */ - @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) private ErrorInnerError innerError; - /** Creates an instance of Error class. */ + /** + * Creates an instance of Error class. + */ public Error() { } /** * Get the code property: Server-defined set of error codes. - * + * * @return the code value. */ public String code() { return this.code; } + /** + * Set the code property: Server-defined set of error codes. + * + * @param code the code value to set. + * @return the Error object itself. + */ + Error withCode(String code) { + this.code = code; + return this; + } + /** * Get the message property: Human-readable representation of the error. - * + * * @return the message value. */ public String message() { return this.message; } + /** + * Set the message property: Human-readable representation of the error. + * + * @param message the message value to set. + * @return the Error object itself. + */ + Error withMessage(String message) { + this.message = message; + return this; + } + /** * Get the target property: Target of the error. - * + * * @return the target value. */ public String target() { return this.target; } + /** + * Set the target property: Target of the error. + * + * @param target the target value to set. + * @return the Error object itself. + */ + Error withTarget(String target) { + this.target = target; + return this; + } + /** * Get the details property: Array of details about specific errors that led to this reported error. - * + * * @return the details value. */ public List details() { return this.details; } + /** + * Set the details property: Array of details about specific errors that led to this reported error. + * + * @param details the details value to set. + * @return the Error object itself. + */ + Error withDetails(List details) { + this.details = details; + return this; + } + /** * Get the innerError property: Object containing more specific information than the current object about the error. - * + * * @return the innerError value. */ public ErrorInnerError innerError() { return this.innerError; } + /** + * Set the innerError property: Object containing more specific information than the current object about the error. + * + * @param innerError the innerError value to set. + * @return the Error object itself. + */ + Error withInnerError(ErrorInnerError innerError) { + this.innerError = innerError; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -103,4 +161,48 @@ public void validate() { innerError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Error. + */ + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Error deserializedError = new Error(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedError.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedError.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedError.details = details; + } else if ("innerError".equals(fieldName)) { + deserializedError.innerError = ErrorInnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedError; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorDefinition.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorDefinition.java index 6299bf231468..5d048c5a6465 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorDefinition.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorDefinition.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Error definition. */ +/** + * Error definition. + */ @Immutable -public final class ErrorDefinition { +public final class ErrorDefinition implements JsonSerializable { /* * Service specific error code which serves as the substatus for the HTTP error code. */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* * Description of the error. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * Internal error details. */ - @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) private List details; - /** Creates an instance of ErrorDefinition class. */ + /** + * Creates an instance of ErrorDefinition class. + */ public ErrorDefinition() { } /** * Get the code property: Service specific error code which serves as the substatus for the HTTP error code. - * + * * @return the code value. */ public String code() { @@ -44,7 +49,7 @@ public String code() { /** * Get the message property: Description of the error. - * + * * @return the message value. */ public String message() { @@ -53,7 +58,7 @@ public String message() { /** * Get the details property: Internal error details. - * + * * @return the details value. */ public List details() { @@ -62,7 +67,7 @@ public List details() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -70,4 +75,44 @@ public void validate() { details().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorDefinition. + */ + public static ErrorDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDefinition deserializedErrorDefinition = new ErrorDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedErrorDefinition.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorDefinition.message = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ErrorDefinition.fromJson(reader1)); + deserializedErrorDefinition.details = details; + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDefinition; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorInnerError.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorInnerError.java index 093b832c63c2..77a25f0a318e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorInnerError.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorInnerError.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Object containing more specific information than the current object about the error. */ +/** + * Object containing more specific information than the current object about the error. + */ @Fluent -public final class ErrorInnerError { +public final class ErrorInnerError implements JsonSerializable { /* * Standard error object. */ - @JsonProperty(value = "innerError") private Error innerError; - /** Creates an instance of ErrorInnerError class. */ + /** + * Creates an instance of ErrorInnerError class. + */ public ErrorInnerError() { } /** * Get the innerError property: Standard error object. - * + * * @return the innerError value. */ public Error innerError() { @@ -31,7 +38,7 @@ public Error innerError() { /** * Set the innerError property: Standard error object. - * + * * @param innerError the innerError value to set. * @return the ErrorInnerError object itself. */ @@ -42,7 +49,7 @@ public ErrorInnerError withInnerError(Error innerError) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { innerError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("innerError", this.innerError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorInnerError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorInnerError if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorInnerError. + */ + public static ErrorInnerError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorInnerError deserializedErrorInnerError = new ErrorInnerError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("innerError".equals(fieldName)) { + deserializedErrorInnerError.innerError = Error.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorInnerError; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ExternalInstallationSoftwareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ExternalInstallationSoftwareConfiguration.java index 25e66f6989e3..d60c68a9364d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ExternalInstallationSoftwareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ExternalInstallationSoftwareConfiguration.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP Software configuration Input when the software is installed externally outside the service. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") -@JsonTypeName("External") +/** + * The SAP Software configuration Input when the software is installed externally outside the service. + */ @Fluent public final class ExternalInstallationSoftwareConfiguration extends SoftwareConfiguration { + /* + * The SAP software installation Type. + */ + private SapSoftwareInstallationType softwareInstallationType = SapSoftwareInstallationType.EXTERNAL; + /* * The resource ID of the virtual machine containing the central server instance. */ - @JsonProperty(value = "centralServerVmId") private String centralServerVmId; - /** Creates an instance of ExternalInstallationSoftwareConfiguration class. */ + /** + * Creates an instance of ExternalInstallationSoftwareConfiguration class. + */ public ExternalInstallationSoftwareConfiguration() { } + /** + * Get the softwareInstallationType property: The SAP software installation Type. + * + * @return the softwareInstallationType value. + */ + @Override + public SapSoftwareInstallationType softwareInstallationType() { + return this.softwareInstallationType; + } + /** * Get the centralServerVmId property: The resource ID of the virtual machine containing the central server * instance. - * + * * @return the centralServerVmId value. */ public String centralServerVmId() { @@ -37,7 +54,7 @@ public String centralServerVmId() { /** * Set the centralServerVmId property: The resource ID of the virtual machine containing the central server * instance. - * + * * @param centralServerVmId the centralServerVmId value to set. * @return the ExternalInstallationSoftwareConfiguration object itself. */ @@ -48,11 +65,53 @@ public ExternalInstallationSoftwareConfiguration withCentralServerVmId(String ce /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("softwareInstallationType", + this.softwareInstallationType == null ? null : this.softwareInstallationType.toString()); + jsonWriter.writeStringField("centralServerVmId", this.centralServerVmId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalInstallationSoftwareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalInstallationSoftwareConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExternalInstallationSoftwareConfiguration. + */ + public static ExternalInstallationSoftwareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalInstallationSoftwareConfiguration deserializedExternalInstallationSoftwareConfiguration + = new ExternalInstallationSoftwareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softwareInstallationType".equals(fieldName)) { + deserializedExternalInstallationSoftwareConfiguration.softwareInstallationType + = SapSoftwareInstallationType.fromString(reader.getString()); + } else if ("centralServerVmId".equals(fieldName)) { + deserializedExternalInstallationSoftwareConfiguration.centralServerVmId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExternalInstallationSoftwareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareConfiguration.java index 9a95f7fca021..625121acc613 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareConfiguration.java @@ -5,36 +5,110 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * File Share configuration details, populated with information on storage configuration mounted on the VIS. The * createAndMount option is selected in case of missing input. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "configurationType", - defaultImpl = FileShareConfiguration.class) -@JsonTypeName("FileShareConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Skip", value = SkipFileShareConfiguration.class), - @JsonSubTypes.Type(name = "CreateAndMount", value = CreateAndMountFileShareConfiguration.class), - @JsonSubTypes.Type(name = "Mount", value = MountFileShareConfiguration.class) -}) @Immutable -public class FileShareConfiguration { - /** Creates an instance of FileShareConfiguration class. */ +public class FileShareConfiguration implements JsonSerializable { + /* + * The type of file share config. + */ + private ConfigurationType configurationType = ConfigurationType.fromString("FileShareConfiguration"); + + /** + * Creates an instance of FileShareConfiguration class. + */ public FileShareConfiguration() { } + /** + * Get the configurationType property: The type of file share config. + * + * @return the configurationType value. + */ + public ConfigurationType configurationType() { + return this.configurationType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileShareConfiguration. + */ + public static FileShareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("configurationType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Skip".equals(discriminatorValue)) { + return SkipFileShareConfiguration.fromJson(readerToUse.reset()); + } else if ("CreateAndMount".equals(discriminatorValue)) { + return CreateAndMountFileShareConfiguration.fromJson(readerToUse.reset()); + } else if ("Mount".equals(discriminatorValue)) { + return MountFileShareConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static FileShareConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareConfiguration deserializedFileShareConfiguration = new FileShareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedFileShareConfiguration.configurationType + = ConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/GatewayServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/GatewayServerProperties.java index fc55202f3ed5..3ea7dcd52afb 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/GatewayServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/GatewayServerProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the SAP Gateway Server properties. */ +/** + * Defines the SAP Gateway Server properties. + */ @Immutable -public final class GatewayServerProperties { +public final class GatewayServerProperties implements JsonSerializable { /* * Gateway Port. */ - @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) private Long port; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; - /** Creates an instance of GatewayServerProperties class. */ + /** + * Creates an instance of GatewayServerProperties class. + */ public GatewayServerProperties() { } /** * Get the port property: Gateway Port. - * + * * @return the port value. */ public Long port() { @@ -37,7 +43,7 @@ public Long port() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -46,9 +52,46 @@ public SapHealthState health() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatewayServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatewayServerProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GatewayServerProperties. + */ + public static GatewayServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatewayServerProperties deserializedGatewayServerProperties = new GatewayServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedGatewayServerProperties.port = reader.getNullable(JsonReader::getLong); + } else if ("health".equals(fieldName)) { + deserializedGatewayServerProperties.health = SapHealthState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGatewayServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HanaDbProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HanaDbProviderInstanceProperties.java index 1c5c6547498d..c2706b343e54 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HanaDbProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HanaDbProviderInstanceProperties.java @@ -5,88 +5,95 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Gets or sets the provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("SapHana") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the provider properties. + */ @Fluent public final class HanaDbProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "SapHana"; + /* * Gets or sets the target virtual machine size. */ - @JsonProperty(value = "hostname") private String hostname; /* * Gets or sets the hana database name. */ - @JsonProperty(value = "dbName") private String dbName; /* * Gets or sets the database sql port. */ - @JsonProperty(value = "sqlPort") private String sqlPort; /* * Gets or sets the database instance number. */ - @JsonProperty(value = "instanceNumber") private String instanceNumber; /* * Gets or sets the database user name. */ - @JsonProperty(value = "dbUsername") private String dbUsername; /* * Gets or sets the database password. */ - @JsonProperty(value = "dbPassword") private String dbPassword; /* * Gets or sets the key vault URI to secret with the database password. */ - @JsonProperty(value = "dbPasswordUri") private String dbPasswordUri; /* * Gets or sets the blob URI to SSL certificate for the DB. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; /* * Gets or sets the hostname(s) in the SSL certificate. */ - @JsonProperty(value = "sslHostNameInCertificate") private String sslHostnameInCertificate; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; /* * Gets or sets the SAP System Identifier. */ - @JsonProperty(value = "sapSid") private String sapSid; - /** Creates an instance of HanaDbProviderInstanceProperties class. */ + /** + * Creates an instance of HanaDbProviderInstanceProperties class. + */ public HanaDbProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the hostname property: Gets or sets the target virtual machine size. - * + * * @return the hostname value. */ public String hostname() { @@ -95,7 +102,7 @@ public String hostname() { /** * Set the hostname property: Gets or sets the target virtual machine size. - * + * * @param hostname the hostname value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -106,7 +113,7 @@ public HanaDbProviderInstanceProperties withHostname(String hostname) { /** * Get the dbName property: Gets or sets the hana database name. - * + * * @return the dbName value. */ public String dbName() { @@ -115,7 +122,7 @@ public String dbName() { /** * Set the dbName property: Gets or sets the hana database name. - * + * * @param dbName the dbName value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -126,7 +133,7 @@ public HanaDbProviderInstanceProperties withDbName(String dbName) { /** * Get the sqlPort property: Gets or sets the database sql port. - * + * * @return the sqlPort value. */ public String sqlPort() { @@ -135,7 +142,7 @@ public String sqlPort() { /** * Set the sqlPort property: Gets or sets the database sql port. - * + * * @param sqlPort the sqlPort value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -146,7 +153,7 @@ public HanaDbProviderInstanceProperties withSqlPort(String sqlPort) { /** * Get the instanceNumber property: Gets or sets the database instance number. - * + * * @return the instanceNumber value. */ public String instanceNumber() { @@ -155,7 +162,7 @@ public String instanceNumber() { /** * Set the instanceNumber property: Gets or sets the database instance number. - * + * * @param instanceNumber the instanceNumber value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -166,7 +173,7 @@ public HanaDbProviderInstanceProperties withInstanceNumber(String instanceNumber /** * Get the dbUsername property: Gets or sets the database user name. - * + * * @return the dbUsername value. */ public String dbUsername() { @@ -175,7 +182,7 @@ public String dbUsername() { /** * Set the dbUsername property: Gets or sets the database user name. - * + * * @param dbUsername the dbUsername value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -186,7 +193,7 @@ public HanaDbProviderInstanceProperties withDbUsername(String dbUsername) { /** * Get the dbPassword property: Gets or sets the database password. - * + * * @return the dbPassword value. */ public String dbPassword() { @@ -195,7 +202,7 @@ public String dbPassword() { /** * Set the dbPassword property: Gets or sets the database password. - * + * * @param dbPassword the dbPassword value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -206,7 +213,7 @@ public HanaDbProviderInstanceProperties withDbPassword(String dbPassword) { /** * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @return the dbPasswordUri value. */ public String dbPasswordUri() { @@ -215,7 +222,7 @@ public String dbPasswordUri() { /** * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @param dbPasswordUri the dbPasswordUri value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -226,7 +233,7 @@ public HanaDbProviderInstanceProperties withDbPasswordUri(String dbPasswordUri) /** * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB. - * + * * @return the sslCertificateUri value. */ public String sslCertificateUri() { @@ -235,7 +242,7 @@ public String sslCertificateUri() { /** * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB. - * + * * @param sslCertificateUri the sslCertificateUri value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -246,7 +253,7 @@ public HanaDbProviderInstanceProperties withSslCertificateUri(String sslCertific /** * Get the sslHostnameInCertificate property: Gets or sets the hostname(s) in the SSL certificate. - * + * * @return the sslHostnameInCertificate value. */ public String sslHostnameInCertificate() { @@ -255,7 +262,7 @@ public String sslHostnameInCertificate() { /** * Set the sslHostnameInCertificate property: Gets or sets the hostname(s) in the SSL certificate. - * + * * @param sslHostnameInCertificate the sslHostnameInCertificate value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -266,7 +273,7 @@ public HanaDbProviderInstanceProperties withSslHostnameInCertificate(String sslH /** * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @return the sslPreference value. */ public SslPreference sslPreference() { @@ -275,7 +282,7 @@ public SslPreference sslPreference() { /** * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @param sslPreference the sslPreference value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -286,7 +293,7 @@ public HanaDbProviderInstanceProperties withSslPreference(SslPreference sslPrefe /** * Get the sapSid property: Gets or sets the SAP System Identifier. - * + * * @return the sapSid value. */ public String sapSid() { @@ -295,7 +302,7 @@ public String sapSid() { /** * Set the sapSid property: Gets or sets the SAP System Identifier. - * + * * @param sapSid the sapSid value to set. * @return the HanaDbProviderInstanceProperties object itself. */ @@ -306,11 +313,82 @@ public HanaDbProviderInstanceProperties withSapSid(String sapSid) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("dbName", this.dbName); + jsonWriter.writeStringField("sqlPort", this.sqlPort); + jsonWriter.writeStringField("instanceNumber", this.instanceNumber); + jsonWriter.writeStringField("dbUsername", this.dbUsername); + jsonWriter.writeStringField("dbPassword", this.dbPassword); + jsonWriter.writeStringField("dbPasswordUri", this.dbPasswordUri); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + jsonWriter.writeStringField("sslHostNameInCertificate", this.sslHostnameInCertificate); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + jsonWriter.writeStringField("sapSid", this.sapSid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HanaDbProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HanaDbProviderInstanceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HanaDbProviderInstanceProperties. + */ + public static HanaDbProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HanaDbProviderInstanceProperties deserializedHanaDbProviderInstanceProperties + = new HanaDbProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.providerType = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.hostname = reader.getString(); + } else if ("dbName".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.dbName = reader.getString(); + } else if ("sqlPort".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.sqlPort = reader.getString(); + } else if ("instanceNumber".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.instanceNumber = reader.getString(); + } else if ("dbUsername".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.dbUsername = reader.getString(); + } else if ("dbPassword".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.dbPassword = reader.getString(); + } else if ("dbPasswordUri".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.dbPasswordUri = reader.getString(); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else if ("sslHostNameInCertificate".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.sslHostnameInCertificate = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else if ("sapSid".equals(fieldName)) { + deserializedHanaDbProviderInstanceProperties.sapSid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHanaDbProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilityConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilityConfiguration.java index f17d0353e069..8a4a01766ce0 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilityConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilityConfiguration.java @@ -6,24 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the high availability configuration. */ +/** + * Gets or sets the high availability configuration. + */ @Fluent -public final class HighAvailabilityConfiguration { +public final class HighAvailabilityConfiguration implements JsonSerializable { /* * The high availability type. */ - @JsonProperty(value = "highAvailabilityType", required = true) private SapHighAvailabilityType highAvailabilityType; - /** Creates an instance of HighAvailabilityConfiguration class. */ + /** + * Creates an instance of HighAvailabilityConfiguration class. + */ public HighAvailabilityConfiguration() { } /** * Get the highAvailabilityType property: The high availability type. - * + * * @return the highAvailabilityType value. */ public SapHighAvailabilityType highAvailabilityType() { @@ -32,7 +39,7 @@ public SapHighAvailabilityType highAvailabilityType() { /** * Set the highAvailabilityType property: The high availability type. - * + * * @param highAvailabilityType the highAvailabilityType value to set. * @return the HighAvailabilityConfiguration object itself. */ @@ -43,17 +50,56 @@ public HighAvailabilityConfiguration withHighAvailabilityType(SapHighAvailabilit /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (highAvailabilityType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property highAvailabilityType in model HighAvailabilityConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property highAvailabilityType in model HighAvailabilityConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilityConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("highAvailabilityType", + this.highAvailabilityType == null ? null : this.highAvailabilityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HighAvailabilityConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HighAvailabilityConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HighAvailabilityConfiguration. + */ + public static HighAvailabilityConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HighAvailabilityConfiguration deserializedHighAvailabilityConfiguration + = new HighAvailabilityConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("highAvailabilityType".equals(fieldName)) { + deserializedHighAvailabilityConfiguration.highAvailabilityType + = SapHighAvailabilityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHighAvailabilityConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilitySoftwareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilitySoftwareConfiguration.java index 5a5483ea03f7..20c13567486d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilitySoftwareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilitySoftwareConfiguration.java @@ -6,31 +6,38 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the HA software configuration. */ +/** + * Gets or sets the HA software configuration. + */ @Fluent -public final class HighAvailabilitySoftwareConfiguration { +public final class HighAvailabilitySoftwareConfiguration + implements JsonSerializable { /* * The fencing client id. */ - @JsonProperty(value = "fencingClientId", required = true) private String fencingClientId; /* * The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop * the cluster VMs. */ - @JsonProperty(value = "fencingClientPassword", required = true) private String fencingClientPassword; - /** Creates an instance of HighAvailabilitySoftwareConfiguration class. */ + /** + * Creates an instance of HighAvailabilitySoftwareConfiguration class. + */ public HighAvailabilitySoftwareConfiguration() { } /** * Get the fencingClientId property: The fencing client id. - * + * * @return the fencingClientId value. */ public String fencingClientId() { @@ -39,7 +46,7 @@ public String fencingClientId() { /** * Set the fencingClientId property: The fencing client id. - * + * * @param fencingClientId the fencingClientId value to set. * @return the HighAvailabilitySoftwareConfiguration object itself. */ @@ -51,7 +58,7 @@ public HighAvailabilitySoftwareConfiguration withFencingClientId(String fencingC /** * Get the fencingClientPassword property: The fencing client id secret/password. The secret should never expire. * This will be used pacemaker to start/stop the cluster VMs. - * + * * @return the fencingClientPassword value. */ public String fencingClientPassword() { @@ -61,7 +68,7 @@ public String fencingClientPassword() { /** * Set the fencingClientPassword property: The fencing client id secret/password. The secret should never expire. * This will be used pacemaker to start/stop the cluster VMs. - * + * * @param fencingClientPassword the fencingClientPassword value to set. * @return the HighAvailabilitySoftwareConfiguration object itself. */ @@ -72,24 +79,62 @@ public HighAvailabilitySoftwareConfiguration withFencingClientPassword(String fe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (fencingClientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property fencingClientId in model HighAvailabilitySoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fencingClientId in model HighAvailabilitySoftwareConfiguration")); } if (fencingClientPassword() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property fencingClientPassword in model" - + " HighAvailabilitySoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fencingClientPassword in model HighAvailabilitySoftwareConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilitySoftwareConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fencingClientId", this.fencingClientId); + jsonWriter.writeStringField("fencingClientPassword", this.fencingClientPassword); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HighAvailabilitySoftwareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HighAvailabilitySoftwareConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HighAvailabilitySoftwareConfiguration. + */ + public static HighAvailabilitySoftwareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HighAvailabilitySoftwareConfiguration deserializedHighAvailabilitySoftwareConfiguration + = new HighAvailabilitySoftwareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fencingClientId".equals(fieldName)) { + deserializedHighAvailabilitySoftwareConfiguration.fencingClientId = reader.getString(); + } else if ("fencingClientPassword".equals(fieldName)) { + deserializedHighAvailabilitySoftwareConfiguration.fencingClientPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHighAvailabilitySoftwareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ImageReference.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ImageReference.java index d9ebc979c985..b7bc5b0b192a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ImageReference.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ImageReference.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Specifies information about the image to use. You can specify information about platform images, marketplace images, @@ -14,23 +18,20 @@ * only be set when you create the scale set. */ @Fluent -public final class ImageReference { +public final class ImageReference implements JsonSerializable { /* * The image publisher. */ - @JsonProperty(value = "publisher") private String publisher; /* * Specifies the offer of the platform image or marketplace image used to create the virtual machine. */ - @JsonProperty(value = "offer") private String offer; /* * The image SKU. */ - @JsonProperty(value = "sku") private String sku; /* @@ -39,16 +40,17 @@ public final class ImageReference { * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not * automatically update after deploy time even if a new version becomes available. */ - @JsonProperty(value = "version") private String version; - /** Creates an instance of ImageReference class. */ + /** + * Creates an instance of ImageReference class. + */ public ImageReference() { } /** * Get the publisher property: The image publisher. - * + * * @return the publisher value. */ public String publisher() { @@ -57,7 +59,7 @@ public String publisher() { /** * Set the publisher property: The image publisher. - * + * * @param publisher the publisher value to set. * @return the ImageReference object itself. */ @@ -69,7 +71,7 @@ public ImageReference withPublisher(String publisher) { /** * Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual * machine. - * + * * @return the offer value. */ public String offer() { @@ -79,7 +81,7 @@ public String offer() { /** * Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual * machine. - * + * * @param offer the offer value to set. * @return the ImageReference object itself. */ @@ -90,7 +92,7 @@ public ImageReference withOffer(String offer) { /** * Get the sku property: The image SKU. - * + * * @return the sku value. */ public String sku() { @@ -99,7 +101,7 @@ public String sku() { /** * Set the sku property: The image SKU. - * + * * @param sku the sku value to set. * @return the ImageReference object itself. */ @@ -113,7 +115,7 @@ public ImageReference withSku(String sku) { * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. - * + * * @return the version value. */ public String version() { @@ -125,7 +127,7 @@ public String version() { * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. - * + * * @param version the version value to set. * @return the ImageReference object itself. */ @@ -136,9 +138,54 @@ public ImageReference withVersion(String version) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("offer", this.offer); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageReference. + */ + public static ImageReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageReference deserializedImageReference = new ImageReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisher".equals(fieldName)) { + deserializedImageReference.publisher = reader.getString(); + } else if ("offer".equals(fieldName)) { + deserializedImageReference.offer = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedImageReference.sku = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedImageReference.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageReference; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/InfrastructureConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/InfrastructureConfiguration.java index 7c6fcc33bf01..cb58b7bc2ae0 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/InfrastructureConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/InfrastructureConfiguration.java @@ -6,37 +6,45 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Deploy SAP Infrastructure Details. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "deploymentType", - defaultImpl = InfrastructureConfiguration.class) -@JsonTypeName("InfrastructureConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "SingleServer", value = SingleServerConfiguration.class), - @JsonSubTypes.Type(name = "ThreeTier", value = ThreeTierConfiguration.class) -}) +/** + * Deploy SAP Infrastructure Details. + */ @Fluent -public class InfrastructureConfiguration { +public class InfrastructureConfiguration implements JsonSerializable { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.fromString("InfrastructureConfiguration"); + /* * The application resource group where SAP system resources will be deployed. */ - @JsonProperty(value = "appResourceGroup", required = true) private String appResourceGroup; - /** Creates an instance of InfrastructureConfiguration class. */ + /** + * Creates an instance of InfrastructureConfiguration class. + */ public InfrastructureConfiguration() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Get the appResourceGroup property: The application resource group where SAP system resources will be deployed. - * + * * @return the appResourceGroup value. */ public String appResourceGroup() { @@ -45,7 +53,7 @@ public String appResourceGroup() { /** * Set the appResourceGroup property: The application resource group where SAP system resources will be deployed. - * + * * @param appResourceGroup the appResourceGroup value to set. * @return the InfrastructureConfiguration object itself. */ @@ -56,17 +64,85 @@ public InfrastructureConfiguration withAppResourceGroup(String appResourceGroup) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (appResourceGroup() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appResourceGroup in model InfrastructureConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appResourceGroup in model InfrastructureConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(InfrastructureConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appResourceGroup", this.appResourceGroup); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InfrastructureConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InfrastructureConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InfrastructureConfiguration. + */ + public static InfrastructureConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("deploymentType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SingleServer".equals(discriminatorValue)) { + return SingleServerConfiguration.fromJson(readerToUse.reset()); + } else if ("ThreeTier".equals(discriminatorValue)) { + return ThreeTierConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static InfrastructureConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InfrastructureConfiguration deserializedInfrastructureConfiguration = new InfrastructureConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appResourceGroup".equals(fieldName)) { + deserializedInfrastructureConfiguration.appResourceGroup = reader.getString(); + } else if ("deploymentType".equals(fieldName)) { + deserializedInfrastructureConfiguration.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInfrastructureConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LinuxConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LinuxConfiguration.java index f18b6343665d..4f682a9dc64f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LinuxConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LinuxConfiguration.java @@ -5,45 +5,58 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported * Linux distributions, see [Linux on Azure-Endorsed * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "osType") -@JsonTypeName("Linux") @Fluent public final class LinuxConfiguration extends OSConfiguration { + /* + * The OS Type + */ + private OSType osType = OSType.LINUX; + /* * Specifies whether password authentication should be disabled. */ - @JsonProperty(value = "disablePasswordAuthentication") private Boolean disablePasswordAuthentication; /* * Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' * instead) */ - @JsonProperty(value = "ssh") private SshConfiguration ssh; /* * The SSH Key-pair used to authenticate with the VM's. */ - @JsonProperty(value = "sshKeyPair") private SshKeyPair sshKeyPair; - /** Creates an instance of LinuxConfiguration class. */ + /** + * Creates an instance of LinuxConfiguration class. + */ public LinuxConfiguration() { } + /** + * Get the osType property: The OS Type. + * + * @return the osType value. + */ + @Override + public OSType osType() { + return this.osType; + } + /** * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. - * + * * @return the disablePasswordAuthentication value. */ public Boolean disablePasswordAuthentication() { @@ -52,7 +65,7 @@ public Boolean disablePasswordAuthentication() { /** * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. - * + * * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. * @return the LinuxConfiguration object itself. */ @@ -64,7 +77,7 @@ public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePassw /** * Get the ssh property: Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please * use 'sshKeyPair' instead). - * + * * @return the ssh value. */ public SshConfiguration ssh() { @@ -74,7 +87,7 @@ public SshConfiguration ssh() { /** * Set the ssh property: Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please * use 'sshKeyPair' instead). - * + * * @param ssh the ssh value to set. * @return the LinuxConfiguration object itself. */ @@ -85,7 +98,7 @@ public LinuxConfiguration withSsh(SshConfiguration ssh) { /** * Get the sshKeyPair property: The SSH Key-pair used to authenticate with the VM's. - * + * * @return the sshKeyPair value. */ public SshKeyPair sshKeyPair() { @@ -94,7 +107,7 @@ public SshKeyPair sshKeyPair() { /** * Set the sshKeyPair property: The SSH Key-pair used to authenticate with the VM's. - * + * * @param sshKeyPair the sshKeyPair value to set. * @return the LinuxConfiguration object itself. */ @@ -105,7 +118,7 @@ public LinuxConfiguration withSshKeyPair(SshKeyPair sshKeyPair) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -118,4 +131,50 @@ public void validate() { sshKeyPair().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + jsonWriter.writeBooleanField("disablePasswordAuthentication", this.disablePasswordAuthentication); + jsonWriter.writeJsonField("ssh", this.ssh); + jsonWriter.writeJsonField("sshKeyPair", this.sshKeyPair); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxConfiguration. + */ + public static LinuxConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxConfiguration deserializedLinuxConfiguration = new LinuxConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedLinuxConfiguration.osType = OSType.fromString(reader.getString()); + } else if ("disablePasswordAuthentication".equals(fieldName)) { + deserializedLinuxConfiguration.disablePasswordAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("ssh".equals(fieldName)) { + deserializedLinuxConfiguration.ssh = SshConfiguration.fromJson(reader); + } else if ("sshKeyPair".equals(fieldName)) { + deserializedLinuxConfiguration.sshKeyPair = SshKeyPair.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerDetails.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerDetails.java index c14130b4d250..2ab10ae0f038 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerDetails.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerDetails.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Load Balancer details such as Load Balancer ID. */ +/** + * The Load Balancer details such as Load Balancer ID. + */ @Immutable -public final class LoadBalancerDetails { +public final class LoadBalancerDetails implements JsonSerializable { /* * The id property. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of LoadBalancerDetails class. */ + /** + * Creates an instance of LoadBalancerDetails class. + */ public LoadBalancerDetails() { } /** * Get the id property: The id property. - * + * * @return the id value. */ public String id() { @@ -31,9 +38,44 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerDetails. + */ + public static LoadBalancerDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerDetails deserializedLoadBalancerDetails = new LoadBalancerDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLoadBalancerDetails.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerDetails; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerResourceNames.java index a39c03014aa2..ca82bbc9566e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerResourceNames.java @@ -5,48 +5,52 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The resource names object for load balancer and related resources. */ +/** + * The resource names object for load balancer and related resources. + */ @Fluent -public final class LoadBalancerResourceNames { +public final class LoadBalancerResourceNames implements JsonSerializable { /* * The full resource name for load balancer. If this value is not provided, load balancer will be name as * {ASCS/DB}-loadBalancer. */ - @JsonProperty(value = "loadBalancerName") private String loadBalancerName; /* - * The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer - * and should be 1 for database layer. + * The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and + * should be 1 for database layer. */ - @JsonProperty(value = "frontendIpConfigurationNames") private List frontendIpConfigurationNames; /* - * The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list - * should be 1 + * The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should + * be 1 */ - @JsonProperty(value = "backendPoolNames") private List backendPoolNames; /* * The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 * for database layer. */ - @JsonProperty(value = "healthProbeNames") private List healthProbeNames; - /** Creates an instance of LoadBalancerResourceNames class. */ + /** + * Creates an instance of LoadBalancerResourceNames class. + */ public LoadBalancerResourceNames() { } /** * Get the loadBalancerName property: The full resource name for load balancer. If this value is not provided, load * balancer will be name as {ASCS/DB}-loadBalancer. - * + * * @return the loadBalancerName value. */ public String loadBalancerName() { @@ -56,7 +60,7 @@ public String loadBalancerName() { /** * Set the loadBalancerName property: The full resource name for load balancer. If this value is not provided, load * balancer will be name as {ASCS/DB}-loadBalancer. - * + * * @param loadBalancerName the loadBalancerName value to set. * @return the LoadBalancerResourceNames object itself. */ @@ -68,7 +72,7 @@ public LoadBalancerResourceNames withLoadBalancerName(String loadBalancerName) { /** * Get the frontendIpConfigurationNames property: The list of frontend IP configuration names. If provided as input, * size of this list should be 2 for cs layer and should be 1 for database layer. - * + * * @return the frontendIpConfigurationNames value. */ public List frontendIpConfigurationNames() { @@ -78,7 +82,7 @@ public List frontendIpConfigurationNames() { /** * Set the frontendIpConfigurationNames property: The list of frontend IP configuration names. If provided as input, * size of this list should be 2 for cs layer and should be 1 for database layer. - * + * * @param frontendIpConfigurationNames the frontendIpConfigurationNames value to set. * @return the LoadBalancerResourceNames object itself. */ @@ -90,7 +94,7 @@ public LoadBalancerResourceNames withFrontendIpConfigurationNames(List f /** * Get the backendPoolNames property: The list of backend pool names. Currently, ACSS deploys only one backend pool * and hence, size of this list should be 1. - * + * * @return the backendPoolNames value. */ public List backendPoolNames() { @@ -100,7 +104,7 @@ public List backendPoolNames() { /** * Set the backendPoolNames property: The list of backend pool names. Currently, ACSS deploys only one backend pool * and hence, size of this list should be 1. - * + * * @param backendPoolNames the backendPoolNames value to set. * @return the LoadBalancerResourceNames object itself. */ @@ -112,7 +116,7 @@ public LoadBalancerResourceNames withBackendPoolNames(List backendPoolNa /** * Get the healthProbeNames property: The list of health probe names. If provided as input, size of this list should * be 2 for cs layer and should be 1 for database layer. - * + * * @return the healthProbeNames value. */ public List healthProbeNames() { @@ -122,7 +126,7 @@ public List healthProbeNames() { /** * Set the healthProbeNames property: The list of health probe names. If provided as input, size of this list should * be 2 for cs layer and should be 1 for database layer. - * + * * @param healthProbeNames the healthProbeNames value to set. * @return the LoadBalancerResourceNames object itself. */ @@ -133,9 +137,60 @@ public LoadBalancerResourceNames withHealthProbeNames(List healthProbeNa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("loadBalancerName", this.loadBalancerName); + jsonWriter.writeArrayField("frontendIpConfigurationNames", this.frontendIpConfigurationNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("backendPoolNames", this.backendPoolNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("healthProbeNames", this.healthProbeNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerResourceNames if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerResourceNames. + */ + public static LoadBalancerResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerResourceNames deserializedLoadBalancerResourceNames = new LoadBalancerResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loadBalancerName".equals(fieldName)) { + deserializedLoadBalancerResourceNames.loadBalancerName = reader.getString(); + } else if ("frontendIpConfigurationNames".equals(fieldName)) { + List frontendIpConfigurationNames = reader.readArray(reader1 -> reader1.getString()); + deserializedLoadBalancerResourceNames.frontendIpConfigurationNames = frontendIpConfigurationNames; + } else if ("backendPoolNames".equals(fieldName)) { + List backendPoolNames = reader.readArray(reader1 -> reader1.getString()); + deserializedLoadBalancerResourceNames.backendPoolNames = backendPoolNames; + } else if ("healthProbeNames".equals(fieldName)) { + List healthProbeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedLoadBalancerResourceNames.healthProbeNames = healthProbeNames; + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedRGConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedRGConfiguration.java index af21758da2fe..59f968e5c30e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedRGConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedRGConfiguration.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Managed resource group configuration. */ +/** + * Managed resource group configuration. + */ @Fluent -public final class ManagedRGConfiguration { +public final class ManagedRGConfiguration implements JsonSerializable { /* * Managed resource group name */ - @JsonProperty(value = "name") private String name; - /** Creates an instance of ManagedRGConfiguration class. */ + /** + * Creates an instance of ManagedRGConfiguration class. + */ public ManagedRGConfiguration() { } /** * Get the name property: Managed resource group name. - * + * * @return the name value. */ public String name() { @@ -31,7 +38,7 @@ public String name() { /** * Set the name property: Managed resource group name. - * + * * @param name the name value to set. * @return the ManagedRGConfiguration object itself. */ @@ -42,9 +49,45 @@ public ManagedRGConfiguration withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRGConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRGConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedRGConfiguration. + */ + public static ManagedRGConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRGConfiguration deserializedManagedRGConfiguration = new ManagedRGConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedRGConfiguration.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRGConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedServiceIdentityType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedServiceIdentityType.java index f64180a50b97..6e877ed972ec 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedServiceIdentityType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedServiceIdentityType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of managed service identity (only None, UserAssigned types are allowed). */ +/** + * Type of managed service identity (only None, UserAssigned types are allowed). + */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value None for ManagedServiceIdentityType. */ + /** + * Static value None for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType NONE = fromString("None"); - /** Static value UserAssigned for ManagedServiceIdentityType. */ + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** * Creates a new instance of ManagedServiceIdentityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ManagedServiceIdentityType() { /** * Creates or finds a ManagedServiceIdentityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } /** * Gets known ManagedServiceIdentityType values. - * + * * @return known ManagedServiceIdentityType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MessageServerProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MessageServerProperties.java index 775f4a45008f..84688759b14a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MessageServerProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MessageServerProperties.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the SAP Message Server properties. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the SAP Message Server properties. + */ @Immutable -public final class MessageServerProperties { +public final class MessageServerProperties implements JsonSerializable { /* * Message Server port. */ - @JsonProperty(value = "msPort", access = JsonProperty.Access.WRITE_ONLY) private Long msPort; /* * Message Server internal MS port. */ - @JsonProperty(value = "internalMsPort", access = JsonProperty.Access.WRITE_ONLY) private Long internalMsPort; /* * Message Server HTTP Port. */ - @JsonProperty(value = "httpPort", access = JsonProperty.Access.WRITE_ONLY) private Long httpPort; /* * Message Server HTTPS Port. */ - @JsonProperty(value = "httpsPort", access = JsonProperty.Access.WRITE_ONLY) private Long httpsPort; /* * Message Server SAP Hostname. */ - @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /* * Message server IP Address. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * Defines the health of SAP Instances. */ - @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) private SapHealthState health; - /** Creates an instance of MessageServerProperties class. */ + /** + * Creates an instance of MessageServerProperties class. + */ public MessageServerProperties() { } /** * Get the msPort property: Message Server port. - * + * * @return the msPort value. */ public Long msPort() { @@ -67,7 +68,7 @@ public Long msPort() { /** * Get the internalMsPort property: Message Server internal MS port. - * + * * @return the internalMsPort value. */ public Long internalMsPort() { @@ -76,7 +77,7 @@ public Long internalMsPort() { /** * Get the httpPort property: Message Server HTTP Port. - * + * * @return the httpPort value. */ public Long httpPort() { @@ -85,7 +86,7 @@ public Long httpPort() { /** * Get the httpsPort property: Message Server HTTPS Port. - * + * * @return the httpsPort value. */ public Long httpsPort() { @@ -94,7 +95,7 @@ public Long httpsPort() { /** * Get the hostname property: Message Server SAP Hostname. - * + * * @return the hostname value. */ public String hostname() { @@ -103,7 +104,7 @@ public String hostname() { /** * Get the ipAddress property: Message server IP Address. - * + * * @return the ipAddress value. */ public String ipAddress() { @@ -112,7 +113,7 @@ public String ipAddress() { /** * Get the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ public SapHealthState health() { @@ -121,9 +122,56 @@ public SapHealthState health() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MessageServerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MessageServerProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MessageServerProperties. + */ + public static MessageServerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MessageServerProperties deserializedMessageServerProperties = new MessageServerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("msPort".equals(fieldName)) { + deserializedMessageServerProperties.msPort = reader.getNullable(JsonReader::getLong); + } else if ("internalMsPort".equals(fieldName)) { + deserializedMessageServerProperties.internalMsPort = reader.getNullable(JsonReader::getLong); + } else if ("httpPort".equals(fieldName)) { + deserializedMessageServerProperties.httpPort = reader.getNullable(JsonReader::getLong); + } else if ("httpsPort".equals(fieldName)) { + deserializedMessageServerProperties.httpsPort = reader.getNullable(JsonReader::getLong); + } else if ("hostname".equals(fieldName)) { + deserializedMessageServerProperties.hostname = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedMessageServerProperties.ipAddress = reader.getString(); + } else if ("health".equals(fieldName)) { + deserializedMessageServerProperties.health = SapHealthState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMessageServerProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitor.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitor.java index 7b1ba01d6771..026ba96b84a5 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitor.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitor.java @@ -10,67 +10,69 @@ import com.azure.resourcemanager.workloads.fluent.models.MonitorInner; import java.util.Map; -/** An immutable client-side representation of Monitor. */ +/** + * An immutable client-side representation of Monitor. + */ public interface Monitor { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @return the identity value. */ UserAssignedServiceIdentity identity(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ WorkloadMonitorProvisioningState provisioningState(); /** * Gets the errors property: Defines the SAP monitor errors. - * + * * @return the errors value. */ MonitorPropertiesErrors errors(); @@ -78,7 +80,7 @@ public interface Monitor { /** * Gets the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The * subnet region should be same as the SAP monitoring region. - * + * * @return the appLocation value. */ String appLocation(); @@ -86,7 +88,7 @@ public interface Monitor { /** * Gets the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. - * + * * @return the routingPreference value. */ RoutingPreference routingPreference(); @@ -94,14 +96,14 @@ public interface Monitor { /** * Gets the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the * SAP monitor. By default resources will be created which do not support zone redundancy. - * + * * @return the zoneRedundancyPreference value. */ String zoneRedundancyPreference(); /** * Gets the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ ManagedRGConfiguration managedResourceGroupConfiguration(); @@ -109,77 +111,84 @@ public interface Monitor { /** * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. - * + * * @return the logAnalyticsWorkspaceArmId value. */ String logAnalyticsWorkspaceArmId(); /** * Gets the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @return the monitorSubnet value. */ String monitorSubnet(); /** * Gets the msiArmId property: The ARM ID of the MSI used for SAP monitoring. - * + * * @return the msiArmId value. */ String msiArmId(); /** * Gets the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. - * + * * @return the storageAccountArmId value. */ String storageAccountArmId(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.MonitorInner object. - * + * * @return the inner object. */ MonitorInner innerModel(); - /** The entirety of the Monitor definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the Monitor definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Monitor definition stages. */ + + /** + * The Monitor definition stages. + */ interface DefinitionStages { - /** The first stage of the Monitor definition. */ + /** + * The first stage of the Monitor definition. + */ interface Blank extends WithLocation { } - /** The stage of the Monitor definition allowing to specify location. */ + + /** + * The stage of the Monitor definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -187,198 +196,233 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Monitor definition allowing to specify parent resource. */ + + /** + * The stage of the Monitor definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Monitor 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.WithIdentity, - DefinitionStages.WithAppLocation, - DefinitionStages.WithRoutingPreference, - DefinitionStages.WithZoneRedundancyPreference, - DefinitionStages.WithManagedResourceGroupConfiguration, - DefinitionStages.WithLogAnalyticsWorkspaceArmId, - DefinitionStages.WithMonitorSubnet { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithAppLocation, DefinitionStages.WithRoutingPreference, + DefinitionStages.WithZoneRedundancyPreference, DefinitionStages.WithManagedResourceGroupConfiguration, + DefinitionStages.WithLogAnalyticsWorkspaceArmId, DefinitionStages.WithMonitorSubnet { /** * Executes the create request. - * + * * @return the created resource. */ Monitor create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Monitor create(Context context); } - /** The stage of the Monitor definition allowing to specify tags. */ + + /** + * The stage of the Monitor definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Monitor definition allowing to specify identity. */ + + /** + * The stage of the Monitor definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: [currently not in use] Managed service identity(user assigned * identities). - * + * * @param identity [currently not in use] Managed service identity(user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(UserAssignedServiceIdentity identity); } - /** The stage of the Monitor definition allowing to specify appLocation. */ + + /** + * The stage of the Monitor definition allowing to specify appLocation. + */ interface WithAppLocation { /** * Specifies the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring * region. The subnet region should be same as the SAP monitoring region.. - * + * * @param appLocation The SAP monitor resources will be deployed in the SAP monitoring region. The subnet - * region should be same as the SAP monitoring region. + * region should be same as the SAP monitoring region. * @return the next definition stage. */ WithCreate withAppLocation(String appLocation); } - /** The stage of the Monitor definition allowing to specify routingPreference. */ + + /** + * The stage of the Monitor definition allowing to specify routingPreference. + */ interface WithRoutingPreference { /** * Specifies the routingPreference property: Sets the routing preference of the SAP monitor. By default only * RFC1918 traffic is routed to the customer VNET.. - * + * * @param routingPreference Sets the routing preference of the SAP monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * is routed to the customer VNET. * @return the next definition stage. */ WithCreate withRoutingPreference(RoutingPreference routingPreference); } - /** The stage of the Monitor definition allowing to specify zoneRedundancyPreference. */ + + /** + * The stage of the Monitor definition allowing to specify zoneRedundancyPreference. + */ interface WithZoneRedundancyPreference { /** * Specifies the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources * created for the SAP monitor. By default resources will be created which do not support zone redundancy.. - * + * * @param zoneRedundancyPreference Sets the preference for zone redundancy on resources created for the SAP - * monitor. By default resources will be created which do not support zone redundancy. + * monitor. By default resources will be created which do not support zone redundancy. * @return the next definition stage. */ WithCreate withZoneRedundancyPreference(String zoneRedundancyPreference); } - /** The stage of the Monitor definition allowing to specify managedResourceGroupConfiguration. */ + + /** + * The stage of the Monitor definition allowing to specify managedResourceGroupConfiguration. + */ interface WithManagedResourceGroupConfiguration { /** * Specifies the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration Managed resource group configuration. * @return the next definition stage. */ WithCreate withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration); } - /** The stage of the Monitor definition allowing to specify logAnalyticsWorkspaceArmId. */ + + /** + * The stage of the Monitor definition allowing to specify logAnalyticsWorkspaceArmId. + */ interface WithLogAnalyticsWorkspaceArmId { /** * Specifies the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used * for SAP monitoring.. - * + * * @param logAnalyticsWorkspaceArmId The ARM ID of the Log Analytics Workspace that is used for SAP - * monitoring. + * monitoring. * @return the next definition stage. */ WithCreate withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId); } - /** The stage of the Monitor definition allowing to specify monitorSubnet. */ + + /** + * The stage of the Monitor definition allowing to specify monitorSubnet. + */ interface WithMonitorSubnet { /** * Specifies the monitorSubnet property: The subnet which the SAP monitor will be deployed in. - * + * * @param monitorSubnet The subnet which the SAP monitor will be deployed in. * @return the next definition stage. */ WithCreate withMonitorSubnet(String monitorSubnet); } } + /** * Begins update for the Monitor resource. - * + * * @return the stage of resource update. */ Monitor.Update update(); - /** The template for Monitor update. */ + /** + * The template for Monitor update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. - * + * * @return the updated resource. */ Monitor apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Monitor apply(Context context); } - /** The Monitor update stages. */ + + /** + * The Monitor update stages. + */ interface UpdateStages { - /** The stage of the Monitor update allowing to specify tags. */ + /** + * The stage of the Monitor update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Gets or sets the Resource tags.. - * + * * @param tags Gets or sets the Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Monitor update allowing to specify identity. */ + + /** + * The stage of the Monitor update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: [currently not in use] Managed service identity(user assigned * identities). - * + * * @param identity [currently not in use] Managed service identity(user assigned identities). * @return the next definition stage. */ Update withIdentity(UserAssignedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Monitor refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorListResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorListResult.java index 82eed2d42917..efd0ef8f6c65 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorListResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.MonitorInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The response from the List SAP monitors operation. */ +/** + * The response from the List SAP monitors operation. + */ @Fluent -public final class MonitorListResult { +public final class MonitorListResult implements JsonSerializable { /* * The list of SAP monitors. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of SAP monitors. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of MonitorListResult class. */ + /** + * Creates an instance of MonitorListResult class. + */ public MonitorListResult() { } /** * Get the value property: The list of SAP monitors. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of SAP monitors. - * + * * @param value the value value to set. * @return the MonitorListResult object itself. */ @@ -50,7 +56,7 @@ public MonitorListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of SAP monitors. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of SAP monitors. - * + * * @param nextLink the nextLink value to set. * @return the MonitorListResult object itself. */ @@ -70,7 +76,7 @@ public MonitorListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorListResult. + */ + public static MonitorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorListResult deserializedMonitorListResult = new MonitorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MonitorInner.fromJson(reader1)); + deserializedMonitorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMonitorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorListResult; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorPropertiesErrors.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorPropertiesErrors.java index 6b290ce5019f..7ad0bd157749 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorPropertiesErrors.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MonitorPropertiesErrors.java @@ -5,21 +5,149 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; -/** Defines the SAP monitor errors. */ +/** + * Defines the SAP monitor errors. + */ @Immutable public final class MonitorPropertiesErrors extends Error { - /** Creates an instance of MonitorPropertiesErrors class. */ + /* + * Server-defined set of error codes. + */ + private String code; + + /* + * Human-readable representation of the error. + */ + private String message; + + /* + * Target of the error. + */ + private String target; + + /* + * Array of details about specific errors that led to this reported error. + */ + private List details; + + /* + * Object containing more specific information than the current object about the error. + */ + private ErrorInnerError innerError; + + /** + * Creates an instance of MonitorPropertiesErrors class. + */ public MonitorPropertiesErrors() { } + /** + * Get the code property: Server-defined set of error codes. + * + * @return the code value. + */ + @Override + public String code() { + return this.code; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + @Override + public String message() { + return this.message; + } + + /** + * Get the target property: Target of the error. + * + * @return the target value. + */ + @Override + public String target() { + return this.target; + } + + /** + * Get the details property: Array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + @Override + public List details() { + return this.details; + } + + /** + * Get the innerError property: Object containing more specific information than the current object about the error. + * + * @return the innerError value. + */ + @Override + public ErrorInnerError innerError() { + return this.innerError; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorPropertiesErrors from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorPropertiesErrors if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitorPropertiesErrors. + */ + public static MonitorPropertiesErrors fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorPropertiesErrors deserializedMonitorPropertiesErrors = new MonitorPropertiesErrors(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMonitorPropertiesErrors.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMonitorPropertiesErrors.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedMonitorPropertiesErrors.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedMonitorPropertiesErrors.details = details; + } else if ("innerError".equals(fieldName)) { + deserializedMonitorPropertiesErrors.innerError = ErrorInnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorPropertiesErrors; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitors.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitors.java index 70dbfb68f81c..78370cd5fae8 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitors.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Monitors.java @@ -8,14 +8,16 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Monitors. */ +/** + * Resource collection API of Monitors. + */ public interface Monitors { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. @@ -24,10 +26,10 @@ public interface Monitors { /** * Gets a list of SAP monitors in the specified subscription. - * - *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each - * SAP monitor. - * + * + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -38,9 +40,9 @@ public interface Monitors { /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -51,9 +53,9 @@ public interface Monitors { /** * Gets a list of SAP monitors - * - *

Gets a list of SAP monitors in the specified resource group. - * + * + * Gets a list of SAP monitors in the specified resource group. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -65,9 +67,9 @@ public interface Monitors { /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -75,15 +77,15 @@ public interface Monitors { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response}. + * {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,9 +97,9 @@ public interface Monitors { /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,9 +111,9 @@ public interface Monitors { /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -124,38 +126,38 @@ public interface Monitors { /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response}. + * {@link Response}. */ Monitor getById(String id); /** * Gets properties of a SAP monitor. - * - *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * + * + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with - * {@link Response}. + * {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -166,9 +168,9 @@ public interface Monitors { /** * Deletes a SAP monitor. - * - *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * + * + * Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -180,7 +182,7 @@ public interface Monitors { /** * Begins definition for a new Monitor resource. - * + * * @param name resource name. * @return the first stage of the new Monitor definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MountFileShareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MountFileShareConfiguration.java index 09e6285f7ddb..497ae721a814 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MountFileShareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MountFileShareConfiguration.java @@ -6,37 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets the file share configuration where the transport directory fileshare already exists, and user wishes to * mount the fileshare as a part of the create infra flow. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("Mount") @Fluent public final class MountFileShareConfiguration extends FileShareConfiguration { + /* + * The type of file share config. + */ + private ConfigurationType configurationType = ConfigurationType.MOUNT; + /* * The fileshare resource ID */ - @JsonProperty(value = "id", required = true) private String id; /* * The private endpoint resource ID */ - @JsonProperty(value = "privateEndpointId", required = true) private String privateEndpointId; - /** Creates an instance of MountFileShareConfiguration class. */ + /** + * Creates an instance of MountFileShareConfiguration class. + */ public MountFileShareConfiguration() { } + /** + * Get the configurationType property: The type of file share config. + * + * @return the configurationType value. + */ + @Override + public ConfigurationType configurationType() { + return this.configurationType; + } + /** * Get the id property: The fileshare resource ID. - * + * * @return the id value. */ public String id() { @@ -45,7 +59,7 @@ public String id() { /** * Set the id property: The fileshare resource ID. - * + * * @param id the id value to set. * @return the MountFileShareConfiguration object itself. */ @@ -56,7 +70,7 @@ public MountFileShareConfiguration withId(String id) { /** * Get the privateEndpointId property: The private endpoint resource ID. - * + * * @return the privateEndpointId value. */ public String privateEndpointId() { @@ -65,7 +79,7 @@ public String privateEndpointId() { /** * Set the privateEndpointId property: The private endpoint resource ID. - * + * * @param privateEndpointId the privateEndpointId value to set. * @return the MountFileShareConfiguration object itself. */ @@ -76,24 +90,67 @@ public MountFileShareConfiguration withPrivateEndpointId(String privateEndpointI /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model MountFileShareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model MountFileShareConfiguration")); } if (privateEndpointId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateEndpointId in model MountFileShareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateEndpointId in model MountFileShareConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(MountFileShareConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("privateEndpointId", this.privateEndpointId); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MountFileShareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MountFileShareConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MountFileShareConfiguration. + */ + public static MountFileShareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MountFileShareConfiguration deserializedMountFileShareConfiguration = new MountFileShareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMountFileShareConfiguration.id = reader.getString(); + } else if ("privateEndpointId".equals(fieldName)) { + deserializedMountFileShareConfiguration.privateEndpointId = reader.getString(); + } else if ("configurationType".equals(fieldName)) { + deserializedMountFileShareConfiguration.configurationType + = ConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMountFileShareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MsSqlServerProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MsSqlServerProviderInstanceProperties.java index e85182ad8e76..8b99d41d78ea 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MsSqlServerProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MsSqlServerProviderInstanceProperties.java @@ -5,70 +5,80 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the SQL server provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("MsSqlServer") +/** + * Gets or sets the SQL server provider properties. + */ @Fluent public final class MsSqlServerProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "MsSqlServer"; + /* * Gets or sets the SQL server host name. */ - @JsonProperty(value = "hostname") private String hostname; /* * Gets or sets the database sql port. */ - @JsonProperty(value = "dbPort") private String dbPort; /* * Gets or sets the database user name. */ - @JsonProperty(value = "dbUsername") private String dbUsername; /* * Gets or sets the database password. */ - @JsonProperty(value = "dbPassword") private String dbPassword; /* * Gets or sets the key vault URI to secret with the database password. */ - @JsonProperty(value = "dbPasswordUri") private String dbPasswordUri; /* * Gets or sets the SAP System Identifier */ - @JsonProperty(value = "sapSid") private String sapSid; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; /* * Gets or sets the blob URI to SSL certificate for the SQL Database. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; - /** Creates an instance of MsSqlServerProviderInstanceProperties class. */ + /** + * Creates an instance of MsSqlServerProviderInstanceProperties class. + */ public MsSqlServerProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the hostname property: Gets or sets the SQL server host name. - * + * * @return the hostname value. */ public String hostname() { @@ -77,7 +87,7 @@ public String hostname() { /** * Set the hostname property: Gets or sets the SQL server host name. - * + * * @param hostname the hostname value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -88,7 +98,7 @@ public MsSqlServerProviderInstanceProperties withHostname(String hostname) { /** * Get the dbPort property: Gets or sets the database sql port. - * + * * @return the dbPort value. */ public String dbPort() { @@ -97,7 +107,7 @@ public String dbPort() { /** * Set the dbPort property: Gets or sets the database sql port. - * + * * @param dbPort the dbPort value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -108,7 +118,7 @@ public MsSqlServerProviderInstanceProperties withDbPort(String dbPort) { /** * Get the dbUsername property: Gets or sets the database user name. - * + * * @return the dbUsername value. */ public String dbUsername() { @@ -117,7 +127,7 @@ public String dbUsername() { /** * Set the dbUsername property: Gets or sets the database user name. - * + * * @param dbUsername the dbUsername value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -128,7 +138,7 @@ public MsSqlServerProviderInstanceProperties withDbUsername(String dbUsername) { /** * Get the dbPassword property: Gets or sets the database password. - * + * * @return the dbPassword value. */ public String dbPassword() { @@ -137,7 +147,7 @@ public String dbPassword() { /** * Set the dbPassword property: Gets or sets the database password. - * + * * @param dbPassword the dbPassword value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -148,7 +158,7 @@ public MsSqlServerProviderInstanceProperties withDbPassword(String dbPassword) { /** * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @return the dbPasswordUri value. */ public String dbPasswordUri() { @@ -157,7 +167,7 @@ public String dbPasswordUri() { /** * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. - * + * * @param dbPasswordUri the dbPasswordUri value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -168,7 +178,7 @@ public MsSqlServerProviderInstanceProperties withDbPasswordUri(String dbPassword /** * Get the sapSid property: Gets or sets the SAP System Identifier. - * + * * @return the sapSid value. */ public String sapSid() { @@ -177,7 +187,7 @@ public String sapSid() { /** * Set the sapSid property: Gets or sets the SAP System Identifier. - * + * * @param sapSid the sapSid value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -188,7 +198,7 @@ public MsSqlServerProviderInstanceProperties withSapSid(String sapSid) { /** * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @return the sslPreference value. */ public SslPreference sslPreference() { @@ -197,7 +207,7 @@ public SslPreference sslPreference() { /** * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @param sslPreference the sslPreference value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -208,7 +218,7 @@ public MsSqlServerProviderInstanceProperties withSslPreference(SslPreference ssl /** * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SQL Database. - * + * * @return the sslCertificateUri value. */ public String sslCertificateUri() { @@ -217,7 +227,7 @@ public String sslCertificateUri() { /** * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SQL Database. - * + * * @param sslCertificateUri the sslCertificateUri value to set. * @return the MsSqlServerProviderInstanceProperties object itself. */ @@ -228,11 +238,73 @@ public MsSqlServerProviderInstanceProperties withSslCertificateUri(String sslCer /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("dbPort", this.dbPort); + jsonWriter.writeStringField("dbUsername", this.dbUsername); + jsonWriter.writeStringField("dbPassword", this.dbPassword); + jsonWriter.writeStringField("dbPasswordUri", this.dbPasswordUri); + jsonWriter.writeStringField("sapSid", this.sapSid); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsSqlServerProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsSqlServerProviderInstanceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MsSqlServerProviderInstanceProperties. + */ + public static MsSqlServerProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsSqlServerProviderInstanceProperties deserializedMsSqlServerProviderInstanceProperties + = new MsSqlServerProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.providerType = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.hostname = reader.getString(); + } else if ("dbPort".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.dbPort = reader.getString(); + } else if ("dbUsername".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.dbUsername = reader.getString(); + } else if ("dbPassword".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.dbPassword = reader.getString(); + } else if ("dbPasswordUri".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.dbPasswordUri = reader.getString(); + } else if ("sapSid".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.sapSid = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedMsSqlServerProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsSqlServerProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NamingPatternType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NamingPatternType.java index 2a9dcae0a88e..4a4910f7532c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NamingPatternType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NamingPatternType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The pattern type to be used for resource naming. */ +/** + * The pattern type to be used for resource naming. + */ public final class NamingPatternType extends ExpandableStringEnum { - /** Static value FullResourceName for NamingPatternType. */ + /** + * Static value FullResourceName for NamingPatternType. + */ public static final NamingPatternType FULL_RESOURCE_NAME = fromString("FullResourceName"); /** * Creates a new instance of NamingPatternType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public NamingPatternType() { /** * Creates or finds a NamingPatternType from its string representation. - * + * * @param name a name to look for. * @return the corresponding NamingPatternType. */ - @JsonCreator public static NamingPatternType fromString(String name) { return fromString(name, NamingPatternType.class); } /** * Gets known NamingPatternType values. - * + * * @return known NamingPatternType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkConfiguration.java index 05f239b6ca42..fb81ab827d84 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkConfiguration.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the network configuration type for SAP system infrastructure that is being deployed. */ +/** + * Defines the network configuration type for SAP system infrastructure that is being deployed. + */ @Fluent -public final class NetworkConfiguration { +public final class NetworkConfiguration implements JsonSerializable { /* * Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system * being deployed */ - @JsonProperty(value = "isSecondaryIpEnabled") private Boolean isSecondaryIpEnabled; - /** Creates an instance of NetworkConfiguration class. */ + /** + * Creates an instance of NetworkConfiguration class. + */ public NetworkConfiguration() { } /** * Get the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network * interface on all VMs of the SAP system being deployed. - * + * * @return the isSecondaryIpEnabled value. */ public Boolean isSecondaryIpEnabled() { @@ -34,7 +41,7 @@ public Boolean isSecondaryIpEnabled() { /** * Set the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network * interface on all VMs of the SAP system being deployed. - * + * * @param isSecondaryIpEnabled the isSecondaryIpEnabled value to set. * @return the NetworkConfiguration object itself. */ @@ -45,9 +52,45 @@ public NetworkConfiguration withIsSecondaryIpEnabled(Boolean isSecondaryIpEnable /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isSecondaryIpEnabled", this.isSecondaryIpEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkConfiguration. + */ + public static NetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfiguration deserializedNetworkConfiguration = new NetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSecondaryIpEnabled".equals(fieldName)) { + deserializedNetworkConfiguration.isSecondaryIpEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkInterfaceResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkInterfaceResourceNames.java index 9fc3d74b1caf..80836699e7b7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkInterfaceResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkInterfaceResourceNames.java @@ -5,22 +5,29 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The resource names object for network interface and related resources. */ +/** + * The resource names object for network interface and related resources. + */ @Fluent -public final class NetworkInterfaceResourceNames { +public final class NetworkInterfaceResourceNames implements JsonSerializable { /* - * The full name for network interface. If name is not provided, service uses a default name based on the - * deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be + * The full name for network interface. If name is not provided, service uses a default name based on the deployment + * type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be * {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For * distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in * case of more than 1 instance per layer. */ - @JsonProperty(value = "networkInterfaceName") private String networkInterfaceName; - /** Creates an instance of NetworkInterfaceResourceNames class. */ + /** + * Creates an instance of NetworkInterfaceResourceNames class. + */ public NetworkInterfaceResourceNames() { } @@ -30,7 +37,7 @@ public NetworkInterfaceResourceNames() { * systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more * than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic * with an incrementor at the end in case of more than 1 instance per layer. - * + * * @return the networkInterfaceName value. */ public String networkInterfaceName() { @@ -43,7 +50,7 @@ public String networkInterfaceName() { * systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more * than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic * with an incrementor at the end in case of more than 1 instance per layer. - * + * * @param networkInterfaceName the networkInterfaceName value to set. * @return the NetworkInterfaceResourceNames object itself. */ @@ -54,9 +61,46 @@ public NetworkInterfaceResourceNames withNetworkInterfaceName(String networkInte /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkInterfaceName", this.networkInterfaceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceResourceNames if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceResourceNames. + */ + public static NetworkInterfaceResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceResourceNames deserializedNetworkInterfaceResourceNames + = new NetworkInterfaceResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaceName".equals(fieldName)) { + deserializedNetworkInterfaceResourceNames.networkInterfaceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSConfiguration.java index 7da749b3255e..e6139aeaa79a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSConfiguration.java @@ -5,32 +5,105 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Defines the OS configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "osType", - defaultImpl = OSConfiguration.class) -@JsonTypeName("OSConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Windows", value = WindowsConfiguration.class), - @JsonSubTypes.Type(name = "Linux", value = LinuxConfiguration.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the OS configuration. + */ @Immutable -public class OSConfiguration { - /** Creates an instance of OSConfiguration class. */ +public class OSConfiguration implements JsonSerializable { + /* + * The OS Type + */ + private OSType osType = OSType.fromString("OSConfiguration"); + + /** + * Creates an instance of OSConfiguration class. + */ public OSConfiguration() { } + /** + * Get the osType property: The OS Type. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OSConfiguration. + */ + public static OSConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("osType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Windows".equals(discriminatorValue)) { + return WindowsConfiguration.fromJson(readerToUse.reset()); + } else if ("Linux".equals(discriminatorValue)) { + return LinuxConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OSConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSConfiguration deserializedOSConfiguration = new OSConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedOSConfiguration.osType = OSType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOSConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSProfile.java index 5c74e706c559..b6d8e2e601fa 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSProfile.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSProfile.java @@ -5,48 +5,51 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is * provisioned. */ @Fluent -public final class OSProfile { +public final class OSProfile implements JsonSerializable { /* * Specifies the name of the administrator account.

This property cannot be updated after the VM is * created.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** * "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length - * (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 + * (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 * characters. */ - @JsonProperty(value = "adminUsername") private String adminUsername; /* - * Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters - *

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

- * **Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to - * be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character - * (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", - * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

For resetting the - * password, see [How to reset the Remote Desktop service or its login password in a Windows + * Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters

+ * **Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

**Max-length + * (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + *
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match + * [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

For resetting the password, see [How + * to reset the Remote Desktop service or its login password in a Windows * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root * password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) */ - @JsonProperty(value = "adminPassword") private String adminPassword; /* * Specifies Windows operating system settings on the virtual machine. */ - @JsonProperty(value = "osConfiguration") private OSConfiguration osConfiguration; - /** Creates an instance of OSProfile class. */ + /** + * Creates an instance of OSProfile class. + */ public OSProfile() { } @@ -58,7 +61,7 @@ public OSProfile() { * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. - * + * * @return the adminUsername value. */ public String adminUsername() { @@ -73,7 +76,7 @@ public String adminUsername() { * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. - * + * * @param adminUsername the adminUsername value to set. * @return the OSProfile object itself. */ @@ -88,13 +91,14 @@ public OSProfile withAdminUsername(String adminUsername) { * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting - * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", + * "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its + * login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure + * Linux VMs using the VMAccess * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). - * + * * @return the adminPassword value. */ public String adminPassword() { @@ -107,13 +111,14 @@ public String adminPassword() { * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special - * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> - * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows - * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting - * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", + * "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its + * login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + * <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure + * Linux VMs using the VMAccess * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). - * + * * @param adminPassword the adminPassword value to set. * @return the OSProfile object itself. */ @@ -124,7 +129,7 @@ public OSProfile withAdminPassword(String adminPassword) { /** * Get the osConfiguration property: Specifies Windows operating system settings on the virtual machine. - * + * * @return the osConfiguration value. */ public OSConfiguration osConfiguration() { @@ -133,7 +138,7 @@ public OSConfiguration osConfiguration() { /** * Set the osConfiguration property: Specifies Windows operating system settings on the virtual machine. - * + * * @param osConfiguration the osConfiguration value to set. * @return the OSProfile object itself. */ @@ -144,7 +149,7 @@ public OSProfile withOsConfiguration(OSConfiguration osConfiguration) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -152,4 +157,46 @@ public void validate() { osConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminUsername", this.adminUsername); + jsonWriter.writeStringField("adminPassword", this.adminPassword); + jsonWriter.writeJsonField("osConfiguration", this.osConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OSProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OSProfile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the OSProfile. + */ + public static OSProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OSProfile deserializedOSProfile = new OSProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminUsername".equals(fieldName)) { + deserializedOSProfile.adminUsername = reader.getString(); + } else if ("adminPassword".equals(fieldName)) { + deserializedOSProfile.adminPassword = reader.getString(); + } else if ("osConfiguration".equals(fieldName)) { + deserializedOSProfile.osConfiguration = OSConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOSProfile; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSType.java index fd1e0d06a239..6cf6db2a5fb3 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The OS Type. */ +/** + * The OS Type. + */ public final class OSType extends ExpandableStringEnum { - /** Static value Linux for OSType. */ + /** + * Static value Linux for OSType. + */ public static final OSType LINUX = fromString("Linux"); - /** Static value Windows for OSType. */ + /** + * Static value Windows for OSType. + */ public static final OSType WINDOWS = fromString("Windows"); /** * Creates a new instance of OSType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public OSType() { /** * Creates or finds a OSType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OSType. */ - @JsonCreator public static OSType fromString(String name) { return fromString(name, OSType.class); } /** * Gets known OSType values. - * + * * @return known OSType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operation.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operation.java index c499b48bfa66..1489a2057591 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operation.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.workloads.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationDisplay.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationDisplay.java index f992b6331660..9ea90133552f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationDisplay.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationDisplay.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,9 +87,50 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationListResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationListResult.java index ad7a9d06f902..4417e974f598 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationListResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationListResult.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,26 +18,26 @@ * results. */ @Immutable -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * URL to get the next set of operation list results (if there are any). */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +46,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +55,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -59,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationStatusResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationStatusResult.java index d255097ff485..6071c64df15d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationStatusResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationStatusResult.java @@ -9,67 +9,69 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of OperationStatusResult. */ +/** + * An immutable client-side representation of OperationStatusResult. + */ public interface OperationStatusResult { /** * Gets the id property: Fully qualified ID for the async operation. - * + * * @return the id value. */ String id(); /** * Gets the name property: Name of the async operation. - * + * * @return the name value. */ String name(); /** * Gets the status property: Operation status. - * + * * @return the status value. */ String status(); /** * Gets the percentComplete property: Percent of the operation that is complete. - * + * * @return the percentComplete value. */ Float percentComplete(); /** * Gets the startTime property: The start time of the operation. - * + * * @return the startTime value. */ OffsetDateTime startTime(); /** * Gets the endTime property: The end time of the operation. - * + * * @return the endTime value. */ OffsetDateTime endTime(); /** * Gets the operations property: The operations list. - * + * * @return the operations value. */ List operations(); /** * Gets the error property: If present, details of the operation error. - * + * * @return the error value. */ ManagementError error(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner object. - * + * * @return the inner object. */ OperationStatusResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operations.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operations.java index ecd3bed6bba0..b70ed98eadf1 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operations.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists all the available API operations under this PR. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Lists all the available API operations under this PR. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDefinitionDisplay.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDefinitionDisplay.java index f3ad05574b66..f25792e3c7a2 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDefinitionDisplay.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDefinitionDisplay.java @@ -5,36 +5,52 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Display information of the operation. */ +/** + * Display information of the operation. + */ @Fluent public final class OperationsDefinitionDisplay extends OperationsDisplayDefinition { - /** Creates an instance of OperationsDefinitionDisplay class. */ + /** + * Creates an instance of OperationsDefinitionDisplay class. + */ public OperationsDefinitionDisplay() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OperationsDefinitionDisplay withProvider(String provider) { super.withProvider(provider); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OperationsDefinitionDisplay withResource(String resource) { super.withResource(resource); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OperationsDefinitionDisplay withOperation(String operation) { super.withOperation(operation); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public OperationsDefinitionDisplay withDescription(String description) { super.withDescription(description); @@ -43,11 +59,57 @@ public OperationsDefinitionDisplay withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", provider()); + jsonWriter.writeStringField("resource", resource()); + jsonWriter.writeStringField("operation", operation()); + jsonWriter.writeStringField("description", description()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationsDefinitionDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationsDefinitionDisplay if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationsDefinitionDisplay. + */ + public static OperationsDefinitionDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationsDefinitionDisplay deserializedOperationsDefinitionDisplay = new OperationsDefinitionDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationsDefinitionDisplay.withProvider(reader.getString()); + } else if ("resource".equals(fieldName)) { + deserializedOperationsDefinitionDisplay.withResource(reader.getString()); + } else if ("operation".equals(fieldName)) { + deserializedOperationsDefinitionDisplay.withOperation(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedOperationsDefinitionDisplay.withDescription(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationsDefinitionDisplay; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDisplayDefinition.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDisplayDefinition.java index ae32f1ea63c6..ae4b700c3dda 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDisplayDefinition.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OperationsDisplayDefinition.java @@ -6,42 +6,46 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the workload operation. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the workload operation. + */ @Fluent -public class OperationsDisplayDefinition { +public class OperationsDisplayDefinition implements JsonSerializable { /* * Defines the workload provider. */ - @JsonProperty(value = "provider", required = true) private String provider; /* * Defines the workload resource. */ - @JsonProperty(value = "resource", required = true) private String resource; /* * Defines the workload operation. */ - @JsonProperty(value = "operation", required = true) private String operation; /* * Describes the workload operation. */ - @JsonProperty(value = "description", required = true) private String description; - /** Creates an instance of OperationsDisplayDefinition class. */ + /** + * Creates an instance of OperationsDisplayDefinition class. + */ public OperationsDisplayDefinition() { } /** * Get the provider property: Defines the workload provider. - * + * * @return the provider value. */ public String provider() { @@ -50,7 +54,7 @@ public String provider() { /** * Set the provider property: Defines the workload provider. - * + * * @param provider the provider value to set. * @return the OperationsDisplayDefinition object itself. */ @@ -61,7 +65,7 @@ public OperationsDisplayDefinition withProvider(String provider) { /** * Get the resource property: Defines the workload resource. - * + * * @return the resource value. */ public String resource() { @@ -70,7 +74,7 @@ public String resource() { /** * Set the resource property: Defines the workload resource. - * + * * @param resource the resource value to set. * @return the OperationsDisplayDefinition object itself. */ @@ -81,7 +85,7 @@ public OperationsDisplayDefinition withResource(String resource) { /** * Get the operation property: Defines the workload operation. - * + * * @return the operation value. */ public String operation() { @@ -90,7 +94,7 @@ public String operation() { /** * Set the operation property: Defines the workload operation. - * + * * @param operation the operation value to set. * @return the OperationsDisplayDefinition object itself. */ @@ -101,7 +105,7 @@ public OperationsDisplayDefinition withOperation(String operation) { /** * Get the description property: Describes the workload operation. - * + * * @return the description value. */ public String description() { @@ -110,7 +114,7 @@ public String description() { /** * Set the description property: Describes the workload operation. - * + * * @param description the description value to set. * @return the OperationsDisplayDefinition object itself. */ @@ -121,35 +125,77 @@ public OperationsDisplayDefinition withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (provider() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property provider in model OperationsDisplayDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property provider in model OperationsDisplayDefinition")); } if (resource() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resource in model OperationsDisplayDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model OperationsDisplayDefinition")); } if (operation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operation in model OperationsDisplayDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operation in model OperationsDisplayDefinition")); } if (description() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model OperationsDisplayDefinition")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model OperationsDisplayDefinition")); } } private static final ClientLogger LOGGER = new ClientLogger(OperationsDisplayDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationsDisplayDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationsDisplayDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationsDisplayDefinition. + */ + public static OperationsDisplayDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationsDisplayDefinition deserializedOperationsDisplayDefinition = new OperationsDisplayDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationsDisplayDefinition.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationsDisplayDefinition.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationsDisplayDefinition.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationsDisplayDefinition.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationsDisplayDefinition; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Origin.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Origin.java index 8c56cb9af7c3..9bb28e3cc838 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Origin.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsSapConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsSapConfiguration.java index d542739f6994..c4f063937293 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsSapConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsSapConfiguration.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the OS and SAP Configurations for Deployment. */ +/** + * Defines the OS and SAP Configurations for Deployment. + */ @Fluent -public final class OsSapConfiguration { +public final class OsSapConfiguration implements JsonSerializable { /* * The url and storage account ID where deployer VM packages are uploaded */ - @JsonProperty(value = "deployerVmPackages") private DeployerVmPackages deployerVmPackages; /* * The FQDN to set for the SAP system */ - @JsonProperty(value = "sapFqdn") private String sapFqdn; - /** Creates an instance of OsSapConfiguration class. */ + /** + * Creates an instance of OsSapConfiguration class. + */ public OsSapConfiguration() { } /** * Get the deployerVmPackages property: The url and storage account ID where deployer VM packages are uploaded. - * + * * @return the deployerVmPackages value. */ public DeployerVmPackages deployerVmPackages() { @@ -37,7 +43,7 @@ public DeployerVmPackages deployerVmPackages() { /** * Set the deployerVmPackages property: The url and storage account ID where deployer VM packages are uploaded. - * + * * @param deployerVmPackages the deployerVmPackages value to set. * @return the OsSapConfiguration object itself. */ @@ -48,7 +54,7 @@ public OsSapConfiguration withDeployerVmPackages(DeployerVmPackages deployerVmPa /** * Get the sapFqdn property: The FQDN to set for the SAP system. - * + * * @return the sapFqdn value. */ public String sapFqdn() { @@ -57,7 +63,7 @@ public String sapFqdn() { /** * Set the sapFqdn property: The FQDN to set for the SAP system. - * + * * @param sapFqdn the sapFqdn value to set. * @return the OsSapConfiguration object itself. */ @@ -68,7 +74,7 @@ public OsSapConfiguration withSapFqdn(String sapFqdn) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -76,4 +82,43 @@ public void validate() { deployerVmPackages().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("deployerVmPackages", this.deployerVmPackages); + jsonWriter.writeStringField("sapFqdn", this.sapFqdn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OsSapConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OsSapConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OsSapConfiguration. + */ + public static OsSapConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OsSapConfiguration deserializedOsSapConfiguration = new OsSapConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deployerVmPackages".equals(fieldName)) { + deserializedOsSapConfiguration.deployerVmPackages = DeployerVmPackages.fromJson(reader); + } else if ("sapFqdn".equals(fieldName)) { + deserializedOsSapConfiguration.sapFqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOsSapConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusHaClusterProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusHaClusterProviderInstanceProperties.java index 3e62fa3a2a00..949326b6896b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusHaClusterProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusHaClusterProviderInstanceProperties.java @@ -5,58 +5,70 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Gets or sets the PrometheusHaCluster provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("PrometheusHaCluster") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the PrometheusHaCluster provider properties. + */ @Fluent public final class PrometheusHaClusterProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "PrometheusHaCluster"; + /* * URL of the Node Exporter endpoint. */ - @JsonProperty(value = "prometheusUrl") private String prometheusUrl; /* * Gets or sets the target machine name. */ - @JsonProperty(value = "hostname") private String hostname; /* * Gets or sets the cluster sid. */ - @JsonProperty(value = "sid") private String sid; /* * Gets or sets the clusterName. */ - @JsonProperty(value = "clusterName") private String clusterName; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; /* * Gets or sets the blob URI to SSL certificate for the HA cluster exporter. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; - /** Creates an instance of PrometheusHaClusterProviderInstanceProperties class. */ + /** + * Creates an instance of PrometheusHaClusterProviderInstanceProperties class. + */ public PrometheusHaClusterProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the prometheusUrl property: URL of the Node Exporter endpoint. - * + * * @return the prometheusUrl value. */ public String prometheusUrl() { @@ -65,7 +77,7 @@ public String prometheusUrl() { /** * Set the prometheusUrl property: URL of the Node Exporter endpoint. - * + * * @param prometheusUrl the prometheusUrl value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -76,7 +88,7 @@ public PrometheusHaClusterProviderInstanceProperties withPrometheusUrl(String pr /** * Get the hostname property: Gets or sets the target machine name. - * + * * @return the hostname value. */ public String hostname() { @@ -85,7 +97,7 @@ public String hostname() { /** * Set the hostname property: Gets or sets the target machine name. - * + * * @param hostname the hostname value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -96,7 +108,7 @@ public PrometheusHaClusterProviderInstanceProperties withHostname(String hostnam /** * Get the sid property: Gets or sets the cluster sid. - * + * * @return the sid value. */ public String sid() { @@ -105,7 +117,7 @@ public String sid() { /** * Set the sid property: Gets or sets the cluster sid. - * + * * @param sid the sid value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -116,7 +128,7 @@ public PrometheusHaClusterProviderInstanceProperties withSid(String sid) { /** * Get the clusterName property: Gets or sets the clusterName. - * + * * @return the clusterName value. */ public String clusterName() { @@ -125,7 +137,7 @@ public String clusterName() { /** * Set the clusterName property: Gets or sets the clusterName. - * + * * @param clusterName the clusterName value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -136,7 +148,7 @@ public PrometheusHaClusterProviderInstanceProperties withClusterName(String clus /** * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @return the sslPreference value. */ public SslPreference sslPreference() { @@ -145,7 +157,7 @@ public SslPreference sslPreference() { /** * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @param sslPreference the sslPreference value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -156,7 +168,7 @@ public PrometheusHaClusterProviderInstanceProperties withSslPreference(SslPrefer /** * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the HA cluster exporter. - * + * * @return the sslCertificateUri value. */ public String sslCertificateUri() { @@ -165,7 +177,7 @@ public String sslCertificateUri() { /** * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the HA cluster exporter. - * + * * @param sslCertificateUri the sslCertificateUri value to set. * @return the PrometheusHaClusterProviderInstanceProperties object itself. */ @@ -176,11 +188,67 @@ public PrometheusHaClusterProviderInstanceProperties withSslCertificateUri(Strin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + jsonWriter.writeStringField("prometheusUrl", this.prometheusUrl); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("sid", this.sid); + jsonWriter.writeStringField("clusterName", this.clusterName); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrometheusHaClusterProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrometheusHaClusterProviderInstanceProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrometheusHaClusterProviderInstanceProperties. + */ + public static PrometheusHaClusterProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrometheusHaClusterProviderInstanceProperties deserializedPrometheusHaClusterProviderInstanceProperties + = new PrometheusHaClusterProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.providerType = reader.getString(); + } else if ("prometheusUrl".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.prometheusUrl = reader.getString(); + } else if ("hostname".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.hostname = reader.getString(); + } else if ("sid".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.sid = reader.getString(); + } else if ("clusterName".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.clusterName = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedPrometheusHaClusterProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrometheusHaClusterProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusOSProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusOSProviderInstanceProperties.java index b37e78faaf4a..4dedbd0dd05a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusOSProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PrometheusOSProviderInstanceProperties.java @@ -5,46 +5,60 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Gets or sets the PrometheusOS provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("PrometheusOS") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the PrometheusOS provider properties. + */ @Fluent public final class PrometheusOSProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "PrometheusOS"; + /* * URL of the Node Exporter endpoint */ - @JsonProperty(value = "prometheusUrl") private String prometheusUrl; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; /* * Gets or sets the blob URI to SSL certificate for the prometheus node exporter. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; /* * Gets or sets the SAP System Identifier */ - @JsonProperty(value = "sapSid") private String sapSid; - /** Creates an instance of PrometheusOSProviderInstanceProperties class. */ + /** + * Creates an instance of PrometheusOSProviderInstanceProperties class. + */ public PrometheusOSProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the prometheusUrl property: URL of the Node Exporter endpoint. - * + * * @return the prometheusUrl value. */ public String prometheusUrl() { @@ -53,7 +67,7 @@ public String prometheusUrl() { /** * Set the prometheusUrl property: URL of the Node Exporter endpoint. - * + * * @param prometheusUrl the prometheusUrl value to set. * @return the PrometheusOSProviderInstanceProperties object itself. */ @@ -64,7 +78,7 @@ public PrometheusOSProviderInstanceProperties withPrometheusUrl(String prometheu /** * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @return the sslPreference value. */ public SslPreference sslPreference() { @@ -73,7 +87,7 @@ public SslPreference sslPreference() { /** * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. - * + * * @param sslPreference the sslPreference value to set. * @return the PrometheusOSProviderInstanceProperties object itself. */ @@ -85,7 +99,7 @@ public PrometheusOSProviderInstanceProperties withSslPreference(SslPreference ss /** * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the prometheus node * exporter. - * + * * @return the sslCertificateUri value. */ public String sslCertificateUri() { @@ -95,7 +109,7 @@ public String sslCertificateUri() { /** * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the prometheus node * exporter. - * + * * @param sslCertificateUri the sslCertificateUri value to set. * @return the PrometheusOSProviderInstanceProperties object itself. */ @@ -106,7 +120,7 @@ public PrometheusOSProviderInstanceProperties withSslCertificateUri(String sslCe /** * Get the sapSid property: Gets or sets the SAP System Identifier. - * + * * @return the sapSid value. */ public String sapSid() { @@ -115,7 +129,7 @@ public String sapSid() { /** * Set the sapSid property: Gets or sets the SAP System Identifier. - * + * * @param sapSid the sapSid value to set. * @return the PrometheusOSProviderInstanceProperties object itself. */ @@ -126,11 +140,61 @@ public PrometheusOSProviderInstanceProperties withSapSid(String sapSid) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + jsonWriter.writeStringField("prometheusUrl", this.prometheusUrl); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + jsonWriter.writeStringField("sapSid", this.sapSid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrometheusOSProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrometheusOSProviderInstanceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrometheusOSProviderInstanceProperties. + */ + public static PrometheusOSProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrometheusOSProviderInstanceProperties deserializedPrometheusOSProviderInstanceProperties + = new PrometheusOSProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedPrometheusOSProviderInstanceProperties.providerType = reader.getString(); + } else if ("prometheusUrl".equals(fieldName)) { + deserializedPrometheusOSProviderInstanceProperties.prometheusUrl = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedPrometheusOSProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedPrometheusOSProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else if ("sapSid".equals(fieldName)) { + deserializedPrometheusOSProviderInstanceProperties.sapSid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrometheusOSProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstance.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstance.java index d4bc8780d7f9..9aeb6a926564 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstance.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstance.java @@ -8,91 +8,104 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; -/** An immutable client-side representation of ProviderInstance. */ +/** + * An immutable client-side representation of ProviderInstance. + */ public interface ProviderInstance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @return the identity value. */ UserAssignedServiceIdentity identity(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: State of provisioning of the provider instance. - * + * * @return the provisioningState value. */ WorkloadMonitorProvisioningState provisioningState(); /** * Gets the errors property: Defines the provider instance errors. - * + * * @return the errors value. */ ProviderInstancePropertiesErrors errors(); /** * Gets the providerSettings property: Defines the provider specific properties. - * + * * @return the providerSettings value. */ ProviderSpecificProperties providerSettings(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner object. - * + * * @return the inner object. */ ProviderInstanceInner innerModel(); - /** The entirety of the ProviderInstance definition. */ + /** + * The entirety of the ProviderInstance definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The ProviderInstance definition stages. */ + + /** + * The ProviderInstance definition stages. + */ interface DefinitionStages { - /** The first stage of the ProviderInstance definition. */ + /** + * The first stage of the ProviderInstance definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ProviderInstance definition allowing to specify parent resource. */ + + /** + * The stage of the ProviderInstance definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, monitorName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @return the next definition stage. */ WithCreate withExistingMonitor(String resourceGroupName, String monitorName); } + /** * The stage of the ProviderInstance 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. @@ -100,51 +113,58 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithIdentity, DefinitionStages.WithProviderSettings { /** * Executes the create request. - * + * * @return the created resource. */ ProviderInstance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ProviderInstance create(Context context); } - /** The stage of the ProviderInstance definition allowing to specify identity. */ + + /** + * The stage of the ProviderInstance definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: [currently not in use] Managed service identity(user assigned * identities). - * + * * @param identity [currently not in use] Managed service identity(user assigned identities). * @return the next definition stage. */ WithCreate withIdentity(UserAssignedServiceIdentity identity); } - /** The stage of the ProviderInstance definition allowing to specify providerSettings. */ + + /** + * The stage of the ProviderInstance definition allowing to specify providerSettings. + */ interface WithProviderSettings { /** * Specifies the providerSettings property: Defines the provider specific properties.. - * + * * @param providerSettings Defines the provider specific properties. * @return the next definition stage. */ WithCreate withProviderSettings(ProviderSpecificProperties providerSettings); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ProviderInstance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstanceListResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstanceListResult.java index 078e131cfaf4..787359c3bcb6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstanceListResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstanceListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The response from the List provider instances operation. */ +/** + * The response from the List provider instances operation. + */ @Fluent -public final class ProviderInstanceListResult { +public final class ProviderInstanceListResult implements JsonSerializable { /* * The list of provider instances. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of provider instances. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ProviderInstanceListResult class. */ + /** + * Creates an instance of ProviderInstanceListResult class. + */ public ProviderInstanceListResult() { } /** * Get the value property: The list of provider instances. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of provider instances. - * + * * @param value the value value to set. * @return the ProviderInstanceListResult object itself. */ @@ -50,7 +56,7 @@ public ProviderInstanceListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of provider instances. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of provider instances. - * + * * @param nextLink the nextLink value to set. * @return the ProviderInstanceListResult object itself. */ @@ -70,7 +76,7 @@ public ProviderInstanceListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProviderInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProviderInstanceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProviderInstanceListResult. + */ + public static ProviderInstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProviderInstanceListResult deserializedProviderInstanceListResult = new ProviderInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProviderInstanceInner.fromJson(reader1)); + deserializedProviderInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProviderInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProviderInstanceListResult; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstancePropertiesErrors.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstancePropertiesErrors.java index 0442e88a4c6b..b5ab33335d54 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstancePropertiesErrors.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstancePropertiesErrors.java @@ -5,21 +5,150 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; -/** Defines the provider instance errors. */ +/** + * Defines the provider instance errors. + */ @Immutable public final class ProviderInstancePropertiesErrors extends Error { - /** Creates an instance of ProviderInstancePropertiesErrors class. */ + /* + * Server-defined set of error codes. + */ + private String code; + + /* + * Human-readable representation of the error. + */ + private String message; + + /* + * Target of the error. + */ + private String target; + + /* + * Array of details about specific errors that led to this reported error. + */ + private List details; + + /* + * Object containing more specific information than the current object about the error. + */ + private ErrorInnerError innerError; + + /** + * Creates an instance of ProviderInstancePropertiesErrors class. + */ public ProviderInstancePropertiesErrors() { } + /** + * Get the code property: Server-defined set of error codes. + * + * @return the code value. + */ + @Override + public String code() { + return this.code; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + @Override + public String message() { + return this.message; + } + + /** + * Get the target property: Target of the error. + * + * @return the target value. + */ + @Override + public String target() { + return this.target; + } + + /** + * Get the details property: Array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + @Override + public List details() { + return this.details; + } + + /** + * Get the innerError property: Object containing more specific information than the current object about the error. + * + * @return the innerError value. + */ + @Override + public ErrorInnerError innerError() { + return this.innerError; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProviderInstancePropertiesErrors from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProviderInstancePropertiesErrors if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProviderInstancePropertiesErrors. + */ + public static ProviderInstancePropertiesErrors fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProviderInstancePropertiesErrors deserializedProviderInstancePropertiesErrors + = new ProviderInstancePropertiesErrors(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedProviderInstancePropertiesErrors.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedProviderInstancePropertiesErrors.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedProviderInstancePropertiesErrors.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedProviderInstancePropertiesErrors.details = details; + } else if ("innerError".equals(fieldName)) { + deserializedProviderInstancePropertiesErrors.innerError = ErrorInnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProviderInstancePropertiesErrors; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstances.java index a404b7227825..878d7b390b3c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstances.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderInstances.java @@ -8,47 +8,49 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ProviderInstances. */ +/** + * Resource collection API of ProviderInstances. + */ public interface ProviderInstances { /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String monitorName); /** * Gets a list of provider instances in the specified SAP monitor. - * - *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of - * each provider instances. - * + * + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of provider instances in the specified SAP monitor as paginated response with {@link - * PagedIterable}. + * @return a list of provider instances in the specified SAP monitor as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String monitorName, Context context); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -57,17 +59,17 @@ public interface ProviderInstances { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response}. + * resource name along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String monitorName, String providerInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String monitorName, + String providerInstanceName, Context context); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -75,16 +77,15 @@ Response getWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name. + * resource name. */ ProviderInstance get(String resourceGroupName, String monitorName, String providerInstanceName); /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -97,10 +98,9 @@ Response getWithResponse( /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param providerInstanceName Name of the provider instance. @@ -110,46 +110,45 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult delete( - String resourceGroupName, String monitorName, String providerInstanceName, Context context); + OperationStatusResult delete(String resourceGroupName, String monitorName, String providerInstanceName, + Context context); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response}. + * resource name along with {@link Response}. */ ProviderInstance getById(String id); /** * Gets properties of a provider instance. - * - *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * + * Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and - * resource name along with {@link Response}. + * resource name along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -160,10 +159,9 @@ OperationStatusResult delete( /** * Deletes a provider instance. - * - *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource - * name. - * + * + * Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -175,7 +173,7 @@ OperationStatusResult delete( /** * Begins definition for a new ProviderInstance resource. - * + * * @param name resource name. * @return the first stage of the new ProviderInstance definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderSpecificProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderSpecificProperties.java index cf556c5d49b9..08fed9bcf49e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderSpecificProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ProviderSpecificProperties.java @@ -5,36 +5,113 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Gets or sets the provider specific properties. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "providerType", - defaultImpl = ProviderSpecificProperties.class) -@JsonTypeName("ProviderSpecificProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "SapHana", value = HanaDbProviderInstanceProperties.class), - @JsonSubTypes.Type(name = "SapNetWeaver", value = SapNetWeaverProviderInstanceProperties.class), - @JsonSubTypes.Type(name = "PrometheusOS", value = PrometheusOSProviderInstanceProperties.class), - @JsonSubTypes.Type(name = "Db2", value = DB2ProviderInstanceProperties.class), - @JsonSubTypes.Type(name = "PrometheusHaCluster", value = PrometheusHaClusterProviderInstanceProperties.class), - @JsonSubTypes.Type(name = "MsSqlServer", value = MsSqlServerProviderInstanceProperties.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the provider specific properties. + */ @Immutable -public class ProviderSpecificProperties { - /** Creates an instance of ProviderSpecificProperties class. */ +public class ProviderSpecificProperties implements JsonSerializable { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "ProviderSpecificProperties"; + + /** + * Creates an instance of ProviderSpecificProperties class. + */ public ProviderSpecificProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + public String providerType() { + return this.providerType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerType", this.providerType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProviderSpecificProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProviderSpecificProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProviderSpecificProperties. + */ + public static ProviderSpecificProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("providerType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SapHana".equals(discriminatorValue)) { + return HanaDbProviderInstanceProperties.fromJson(readerToUse.reset()); + } else if ("SapNetWeaver".equals(discriminatorValue)) { + return SapNetWeaverProviderInstanceProperties.fromJson(readerToUse.reset()); + } else if ("PrometheusOS".equals(discriminatorValue)) { + return PrometheusOSProviderInstanceProperties.fromJson(readerToUse.reset()); + } else if ("Db2".equals(discriminatorValue)) { + return DB2ProviderInstanceProperties.fromJson(readerToUse.reset()); + } else if ("PrometheusHaCluster".equals(discriminatorValue)) { + return PrometheusHaClusterProviderInstanceProperties.fromJson(readerToUse.reset()); + } else if ("MsSqlServer".equals(discriminatorValue)) { + return MsSqlServerProviderInstanceProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ProviderSpecificProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProviderSpecificProperties deserializedProviderSpecificProperties = new ProviderSpecificProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedProviderSpecificProperties.providerType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProviderSpecificProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ResourceProviders.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ResourceProviders.java index a4c64d01c334..e8b17ff58374 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ResourceProviders.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ResourceProviders.java @@ -7,12 +7,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ResourceProviders. */ +/** + * Resource collection API of ResourceProviders. + */ public interface ResourceProviders { /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @param sapSizingRecommendation SAP Sizing Recommendation Request body. * @param context The context to associate with this operation. @@ -20,27 +22,27 @@ public interface ResourceProviders { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier along with {@link Response}. + * tier along with {@link Response}. */ - Response sapSizingRecommendationsWithResponse( - String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + Response sapSizingRecommendationsWithResponse(String location, + SapSizingRecommendationRequest sapSizingRecommendation, Context context); /** * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database * tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database - * tier. + * tier. */ SapSizingRecommendationResult sapSizingRecommendations(String location); /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @param sapSupportedSku SAP Supported SKU Request body. * @param context The context to associate with this operation. @@ -49,12 +51,12 @@ Response sapSizingRecommendationsWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. */ - Response sapSupportedSkuWithResponse( - String location, SapSupportedSkusRequest sapSupportedSku, Context context); + Response sapSupportedSkuWithResponse(String location, + SapSupportedSkusRequest sapSupportedSku, Context context); /** * Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,7 +67,7 @@ Response sapSupportedSkuWithResponse( /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @param sapDiskConfigurations SAP Disk Configurations Request body. * @param context The context to associate with this operation. @@ -74,12 +76,12 @@ Response sapSupportedSkuWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. */ - Response sapDiskConfigurationsWithResponse( - String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + Response sapDiskConfigurationsWithResponse(String location, + SapDiskConfigurationsRequest sapDiskConfigurations, Context context); /** * Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,7 +92,7 @@ Response sapDiskConfigurationsWithResponse( /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. * @param context The context to associate with this operation. @@ -99,12 +101,12 @@ Response sapDiskConfigurationsWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. */ - Response sapAvailabilityZoneDetailsWithResponse( - String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); + Response sapAvailabilityZoneDetailsWithResponse(String location, + SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); /** * Get the recommended SAP Availability Zone Pair Details for your region. - * + * * @param location The name of Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RoutingPreference.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RoutingPreference.java index c5ab1528a1dc..4cde5e48b954 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RoutingPreference.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RoutingPreference.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. */ +/** + * Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. + */ public final class RoutingPreference extends ExpandableStringEnum { - /** Static value Default for RoutingPreference. */ + /** + * Static value Default for RoutingPreference. + */ public static final RoutingPreference DEFAULT = fromString("Default"); - /** Static value RouteAll for RoutingPreference. */ + /** + * Static value RouteAll for RoutingPreference. + */ public static final RoutingPreference ROUTE_ALL = fromString("RouteAll"); /** * Creates a new instance of RoutingPreference value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public RoutingPreference() { /** * Creates or finds a RoutingPreference from its string representation. - * + * * @param name a name to look for. * @return the corresponding RoutingPreference. */ - @JsonCreator public static RoutingPreference fromString(String name) { return fromString(name, RoutingPreference.class); } /** * Gets known RoutingPreference values. - * + * * @return known RoutingPreference values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstance.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstance.java index 5cfadd81d209..dc81e674821d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstance.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstance.java @@ -11,109 +11,111 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of SapApplicationServerInstance. */ +/** + * An immutable client-side representation of SapApplicationServerInstance. + */ public interface SapApplicationServerInstance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the instanceNo property: Application server Instance Number. - * + * * @return the instanceNo value. */ String instanceNo(); /** * Gets the subnet property: Application server Subnet. - * + * * @return the subnet value. */ String subnet(); /** * Gets the hostname property: Application server instance SAP hostname. - * + * * @return the hostname value. */ String hostname(); /** * Gets the kernelVersion property: Application server instance SAP Kernel Version. - * + * * @return the kernelVersion value. */ String kernelVersion(); /** * Gets the kernelPatch property: Application server instance SAP Kernel Patch level. - * + * * @return the kernelPatch value. */ String kernelPatch(); /** * Gets the ipAddress property: Application server instance SAP IP Address. - * + * * @return the ipAddress value. */ String ipAddress(); /** * Gets the gatewayPort property: Application server instance gateway Port. - * + * * @return the gatewayPort value. */ Long gatewayPort(); /** * Gets the icmHttpPort property: Application server instance ICM HTTP Port. - * + * * @return the icmHttpPort value. */ Long icmHttpPort(); /** * Gets the icmHttpsPort property: Application server instance ICM HTTPS Port. - * + * * @return the icmHttpsPort value. */ Long icmHttpsPort(); @@ -121,91 +123,98 @@ public interface SapApplicationServerInstance { /** * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application * Server Virtual Machines. - * + * * @return the loadBalancerDetails value. */ LoadBalancerDetails loadBalancerDetails(); /** * Gets the vmDetails property: The list of virtual machines. - * + * * @return the vmDetails value. */ List vmDetails(); /** * Gets the status property: Defines the SAP Instance status. - * + * * @return the status value. */ SapVirtualInstanceStatus status(); /** * Gets the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ SapHealthState health(); /** * Gets the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ SapVirtualInstanceProvisioningState provisioningState(); /** * Gets the errors property: Defines the Application Instance errors. - * + * * @return the errors value. */ SapVirtualInstanceError errors(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner object. - * + * * @return the inner object. */ SapApplicationServerInstanceInner innerModel(); - /** The entirety of the SapApplicationServerInstance definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { + /** + * The entirety of the SapApplicationServerInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The SapApplicationServerInstance definition stages. */ + + /** + * The SapApplicationServerInstance definition stages. + */ interface DefinitionStages { - /** The first stage of the SapApplicationServerInstance definition. */ + /** + * The first stage of the SapApplicationServerInstance definition. + */ interface Blank extends WithLocation { } - /** The stage of the SapApplicationServerInstance definition allowing to specify location. */ + + /** + * The stage of the SapApplicationServerInstance definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -213,23 +222,27 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the SapApplicationServerInstance definition allowing to specify parent resource. */ + + /** + * The stage of the SapApplicationServerInstance definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, sapVirtualInstanceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @return the next definition stage. */ WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); } + /** * The stage of the SapApplicationServerInstance 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. @@ -237,77 +250,89 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ SapApplicationServerInstance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SapApplicationServerInstance create(Context context); } - /** The stage of the SapApplicationServerInstance definition allowing to specify tags. */ + + /** + * The stage of the SapApplicationServerInstance definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } } + /** * Begins update for the SapApplicationServerInstance resource. - * + * * @return the stage of resource update. */ SapApplicationServerInstance.Update update(); - /** The template for SapApplicationServerInstance update. */ + /** + * The template for SapApplicationServerInstance update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ SapApplicationServerInstance apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ SapApplicationServerInstance apply(Context context); } - /** The SapApplicationServerInstance update stages. */ + + /** + * The SapApplicationServerInstance update stages. + */ interface UpdateStages { - /** The stage of the SapApplicationServerInstance update allowing to specify tags. */ + /** + * The stage of the SapApplicationServerInstance update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Gets or sets the Resource tags.. - * + * * @param tags Gets or sets the Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SapApplicationServerInstance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -315,7 +340,7 @@ interface WithTags { /** * Starts the SAP Application Server Instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -324,7 +349,7 @@ interface WithTags { /** * Starts the SAP Application Server Instance. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -335,7 +360,7 @@ interface WithTags { /** * Stops the SAP Application Server Instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -344,7 +369,7 @@ interface WithTags { /** * Stops the SAP Application Server Instance. - * + * * @param body SAP Application server instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstanceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstanceList.java index 8f4cfdb09011..895c6038250d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstanceList.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstanceList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the collection of SAP Application Server Instance resources. */ +/** + * Defines the collection of SAP Application Server Instance resources. + */ @Fluent -public final class SapApplicationServerInstanceList { +public final class SapApplicationServerInstanceList implements JsonSerializable { /* * Gets the list of SAP Application Server instance resources. */ - @JsonProperty(value = "value") private List value; /* * Gets the value of next link. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of SapApplicationServerInstanceList class. */ + /** + * Creates an instance of SapApplicationServerInstanceList class. + */ public SapApplicationServerInstanceList() { } /** * Get the value property: Gets the list of SAP Application Server instance resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: Gets the list of SAP Application Server instance resources. - * + * * @param value the value value to set. * @return the SapApplicationServerInstanceList object itself. */ @@ -50,7 +56,7 @@ public SapApplicationServerInstanceList withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapApplicationServerInstanceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapApplicationServerInstanceList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapApplicationServerInstanceList. + */ + public static SapApplicationServerInstanceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapApplicationServerInstanceList deserializedSapApplicationServerInstanceList + = new SapApplicationServerInstanceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SapApplicationServerInstanceInner.fromJson(reader1)); + deserializedSapApplicationServerInstanceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSapApplicationServerInstanceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapApplicationServerInstanceList; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstances.java index 567fc3ad79fe..a198cf904e12 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstances.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstances.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SapApplicationServerInstances. */ +/** + * Resource collection API of SapApplicationServerInstances. + */ public interface SapApplicationServerInstances { /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -21,14 +23,14 @@ public interface SapApplicationServerInstances { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response}. + * along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -37,13 +39,13 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. */ - SapApplicationServerInstance get( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + SapApplicationServerInstance get(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -52,13 +54,13 @@ SapApplicationServerInstance get( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -68,40 +70,40 @@ OperationStatusResult delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); /** * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Application Server Instance resources as paginated response with + * {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context); + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -110,12 +112,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Starts the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -125,12 +127,12 @@ OperationStatusResult startInstance( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, Context context); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -139,12 +141,12 @@ OperationStatusResult startInstance( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName); /** * Stops the SAP Application Server Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param applicationInstanceName The name of SAP Application Server instance resource. @@ -155,42 +157,38 @@ OperationStatusResult stopInstance( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String applicationInstanceName, - StopRequest body, - Context context); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String applicationInstanceName, StopRequest body, Context context); /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response}. + * along with {@link Response}. */ SapApplicationServerInstance getById(String id); /** * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource - * along with {@link Response}. + * along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -202,7 +200,7 @@ OperationStatusResult stopInstance( /** * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service * only. Delete by end user will return a Bad Request error. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -214,7 +212,7 @@ OperationStatusResult stopInstance( /** * Begins definition for a new SapApplicationServerInstance resource. - * + * * @param name resource name. * @return the first stage of the new SapApplicationServerInstance definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsRequest.java index 9ed769550418..0a0ab75d8175 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsRequest.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP request to get list of availability zones. */ +/** + * The SAP request to get list of availability zones. + */ @Fluent -public final class SapAvailabilityZoneDetailsRequest { +public final class SapAvailabilityZoneDetailsRequest implements JsonSerializable { /* * The geo-location where the SAP resources will be created. */ - @JsonProperty(value = "appLocation", required = true) private String appLocation; /* * Defines the SAP Product type. */ - @JsonProperty(value = "sapProduct", required = true) private SapProductType sapProduct; /* * The database type. Eg: HANA, DB2, etc */ - @JsonProperty(value = "databaseType", required = true) private SapDatabaseType databaseType; - /** Creates an instance of SapAvailabilityZoneDetailsRequest class. */ + /** + * Creates an instance of SapAvailabilityZoneDetailsRequest class. + */ public SapAvailabilityZoneDetailsRequest() { } /** * Get the appLocation property: The geo-location where the SAP resources will be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -44,7 +49,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the SAP resources will be created. - * + * * @param appLocation the appLocation value to set. * @return the SapAvailabilityZoneDetailsRequest object itself. */ @@ -55,7 +60,7 @@ public SapAvailabilityZoneDetailsRequest withAppLocation(String appLocation) { /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -64,7 +69,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapAvailabilityZoneDetailsRequest object itself. */ @@ -75,7 +80,7 @@ public SapAvailabilityZoneDetailsRequest withSapProduct(SapProductType sapProduc /** * Get the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -84,7 +89,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @param databaseType the databaseType value to set. * @return the SapAvailabilityZoneDetailsRequest object itself. */ @@ -95,29 +100,72 @@ public SapAvailabilityZoneDetailsRequest withDatabaseType(SapDatabaseType databa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (appLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appLocation in model SapAvailabilityZoneDetailsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appLocation in model SapAvailabilityZoneDetailsRequest")); } if (sapProduct() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapProduct in model SapAvailabilityZoneDetailsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapProduct in model SapAvailabilityZoneDetailsRequest")); } if (databaseType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseType in model SapAvailabilityZoneDetailsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseType in model SapAvailabilityZoneDetailsRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(SapAvailabilityZoneDetailsRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeStringField("sapProduct", this.sapProduct == null ? null : this.sapProduct.toString()); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapAvailabilityZoneDetailsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapAvailabilityZoneDetailsRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapAvailabilityZoneDetailsRequest. + */ + public static SapAvailabilityZoneDetailsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapAvailabilityZoneDetailsRequest deserializedSapAvailabilityZoneDetailsRequest + = new SapAvailabilityZoneDetailsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appLocation".equals(fieldName)) { + deserializedSapAvailabilityZoneDetailsRequest.appLocation = reader.getString(); + } else if ("sapProduct".equals(fieldName)) { + deserializedSapAvailabilityZoneDetailsRequest.sapProduct + = SapProductType.fromString(reader.getString()); + } else if ("databaseType".equals(fieldName)) { + deserializedSapAvailabilityZoneDetailsRequest.databaseType + = SapDatabaseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapAvailabilityZoneDetailsRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsResult.java index 78e3cd511aa8..2df01a29130c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsResult.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; import java.util.List; -/** An immutable client-side representation of SapAvailabilityZoneDetailsResult. */ +/** + * An immutable client-side representation of SapAvailabilityZoneDetailsResult. + */ public interface SapAvailabilityZoneDetailsResult { /** * Gets the availabilityZonePairs property: Gets the list of availability zone pairs. - * + * * @return the availabilityZonePairs value. */ List availabilityZonePairs(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner object. - * + * * @return the inner object. */ SapAvailabilityZoneDetailsResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZonePair.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZonePair.java index 8a0d865ea1c2..890d57165249 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZonePair.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZonePair.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP Availability Zone Pair. */ +/** + * The SAP Availability Zone Pair. + */ @Fluent -public final class SapAvailabilityZonePair { +public final class SapAvailabilityZonePair implements JsonSerializable { /* * The zone A. */ - @JsonProperty(value = "zoneA") private Long zoneA; /* * The zone B. */ - @JsonProperty(value = "zoneB") private Long zoneB; - /** Creates an instance of SapAvailabilityZonePair class. */ + /** + * Creates an instance of SapAvailabilityZonePair class. + */ public SapAvailabilityZonePair() { } /** * Get the zoneA property: The zone A. - * + * * @return the zoneA value. */ public Long zoneA() { @@ -37,7 +43,7 @@ public Long zoneA() { /** * Set the zoneA property: The zone A. - * + * * @param zoneA the zoneA value to set. * @return the SapAvailabilityZonePair object itself. */ @@ -48,7 +54,7 @@ public SapAvailabilityZonePair withZoneA(Long zoneA) { /** * Get the zoneB property: The zone B. - * + * * @return the zoneB value. */ public Long zoneB() { @@ -57,7 +63,7 @@ public Long zoneB() { /** * Set the zoneB property: The zone B. - * + * * @param zoneB the zoneB value to set. * @return the SapAvailabilityZonePair object itself. */ @@ -68,9 +74,48 @@ public SapAvailabilityZonePair withZoneB(Long zoneB) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("zoneA", this.zoneA); + jsonWriter.writeNumberField("zoneB", this.zoneB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapAvailabilityZonePair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapAvailabilityZonePair if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapAvailabilityZonePair. + */ + public static SapAvailabilityZonePair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapAvailabilityZonePair deserializedSapAvailabilityZonePair = new SapAvailabilityZonePair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("zoneA".equals(fieldName)) { + deserializedSapAvailabilityZonePair.zoneA = reader.getNullable(JsonReader::getLong); + } else if ("zoneB".equals(fieldName)) { + deserializedSapAvailabilityZonePair.zoneB = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedSapAvailabilityZonePair; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstanceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstanceList.java index c24bcecd9b30..000a1d217dda 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstanceList.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstanceList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the collection of SAP Central Services Instance resources. */ +/** + * Defines the collection of SAP Central Services Instance resources. + */ @Fluent -public final class SapCentralInstanceList { +public final class SapCentralInstanceList implements JsonSerializable { /* * Gets the list of SAP central services instance resources. */ - @JsonProperty(value = "value") private List value; /* * Gets the value of next link. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of SapCentralInstanceList class. */ + /** + * Creates an instance of SapCentralInstanceList class. + */ public SapCentralInstanceList() { } /** * Get the value property: Gets the list of SAP central services instance resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: Gets the list of SAP central services instance resources. - * + * * @param value the value value to set. * @return the SapCentralInstanceList object itself. */ @@ -50,7 +56,7 @@ public SapCentralInstanceList withValue(List valu /** * Get the nextLink property: Gets the value of next link. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: Gets the value of next link. - * + * * @param nextLink the nextLink value to set. * @return the SapCentralInstanceList object itself. */ @@ -70,7 +76,7 @@ public SapCentralInstanceList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapCentralInstanceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapCentralInstanceList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapCentralInstanceList. + */ + public static SapCentralInstanceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapCentralInstanceList deserializedSapCentralInstanceList = new SapCentralInstanceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SapCentralServerInstanceInner.fromJson(reader1)); + deserializedSapCentralInstanceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSapCentralInstanceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapCentralInstanceList; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstances.java index 6f5ec7660b5e..1ff7a7d19daf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstances.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstances.java @@ -8,31 +8,33 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SapCentralInstances. */ +/** + * Resource collection API of SapCentralInstances. + */ public interface SapCentralInstances { /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Central Services Instance resource along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context); /** * Gets the SAP Central Services Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -44,11 +46,11 @@ Response getWithResponse( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -60,101 +62,101 @@ Response getWithResponse( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, + Context context); /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); /** * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link - * PagedIterable}. + * @return defines the collection of SAP Central Services Instance resources as paginated response with + * {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, String sapVirtualInstanceName, Context context); + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Starts the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, Context context); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName); /** * Stops the SAP Central Services Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto - * generation to work correctly. + * generation to work correctly. * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -162,16 +164,12 @@ OperationStatusResult stopInstance( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String centralInstanceName, - StopRequest body, - Context context); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String centralInstanceName, StopRequest body, Context context); /** * Gets the SAP Central Services Instance resource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -182,7 +180,7 @@ OperationStatusResult stopInstance( /** * Gets the SAP Central Services Instance resource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -196,7 +194,7 @@ OperationStatusResult stopInstance( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -209,7 +207,7 @@ OperationStatusResult stopInstance( * Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete * operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which * is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -221,7 +219,7 @@ OperationStatusResult stopInstance( /** * Begins definition for a new SapCentralServerInstance resource. - * + * * @param name resource name. * @return the first stage of the new SapCentralServerInstance definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralServerInstance.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralServerInstance.java index 21953bc460be..7ce6989eba18 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralServerInstance.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralServerInstance.java @@ -11,81 +11,83 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of SapCentralServerInstance. */ +/** + * An immutable client-side representation of SapCentralServerInstance. + */ public interface SapCentralServerInstance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the instanceNo property: The central services instance number. - * + * * @return the instanceNo value. */ String instanceNo(); /** * Gets the subnet property: The central services instance subnet. - * + * * @return the subnet value. */ String subnet(); /** * Gets the messageServerProperties property: Defines the SAP Message Server properties. - * + * * @return the messageServerProperties value. */ MessageServerProperties messageServerProperties(); /** * Gets the enqueueServerProperties property: Defines the SAP Enqueue Server properties. - * + * * @return the enqueueServerProperties value. */ EnqueueServerProperties enqueueServerProperties(); /** * Gets the gatewayServerProperties property: Defines the SAP Gateway Server properties. - * + * * @return the gatewayServerProperties value. */ GatewayServerProperties gatewayServerProperties(); @@ -93,21 +95,21 @@ public interface SapCentralServerInstance { /** * Gets the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) * properties. - * + * * @return the enqueueReplicationServerProperties value. */ EnqueueReplicationServerProperties enqueueReplicationServerProperties(); /** * Gets the kernelVersion property: The central services instance Kernel Version. - * + * * @return the kernelVersion value. */ String kernelVersion(); /** * Gets the kernelPatch property: The central services instance Kernel Patch level. - * + * * @return the kernelPatch value. */ String kernelPatch(); @@ -115,91 +117,98 @@ public interface SapCentralServerInstance { /** * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual * Machines. - * + * * @return the loadBalancerDetails value. */ LoadBalancerDetails loadBalancerDetails(); /** * Gets the vmDetails property: The list of virtual machines corresponding to the Central Services instance. - * + * * @return the vmDetails value. */ List vmDetails(); /** * Gets the status property: Defines the SAP Instance status. - * + * * @return the status value. */ SapVirtualInstanceStatus status(); /** * Gets the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ SapHealthState health(); /** * Gets the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ SapVirtualInstanceProvisioningState provisioningState(); /** * Gets the errors property: Defines the errors related to SAP Central Services Instance resource. - * + * * @return the errors value. */ SapVirtualInstanceError errors(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner object. - * + * * @return the inner object. */ SapCentralServerInstanceInner innerModel(); - /** The entirety of the SapCentralServerInstance definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { + /** + * The entirety of the SapCentralServerInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The SapCentralServerInstance definition stages. */ + + /** + * The SapCentralServerInstance definition stages. + */ interface DefinitionStages { - /** The first stage of the SapCentralServerInstance definition. */ + /** + * The first stage of the SapCentralServerInstance definition. + */ interface Blank extends WithLocation { } - /** The stage of the SapCentralServerInstance definition allowing to specify location. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -207,88 +216,102 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the SapCentralServerInstance definition allowing to specify parent resource. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, sapVirtualInstanceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @return the next definition stage. */ WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); } + /** * The stage of the SapCentralServerInstance 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.WithMessageServerProperties, - DefinitionStages.WithEnqueueServerProperties, - DefinitionStages.WithGatewayServerProperties, - DefinitionStages.WithEnqueueReplicationServerProperties { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithMessageServerProperties, + DefinitionStages.WithEnqueueServerProperties, DefinitionStages.WithGatewayServerProperties, + DefinitionStages.WithEnqueueReplicationServerProperties { /** * Executes the create request. - * + * * @return the created resource. */ SapCentralServerInstance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SapCentralServerInstance create(Context context); } - /** The stage of the SapCentralServerInstance definition allowing to specify tags. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the SapCentralServerInstance definition allowing to specify messageServerProperties. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify messageServerProperties. + */ interface WithMessageServerProperties { /** * Specifies the messageServerProperties property: Defines the SAP Message Server properties.. - * + * * @param messageServerProperties Defines the SAP Message Server properties. * @return the next definition stage. */ WithCreate withMessageServerProperties(MessageServerProperties messageServerProperties); } - /** The stage of the SapCentralServerInstance definition allowing to specify enqueueServerProperties. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify enqueueServerProperties. + */ interface WithEnqueueServerProperties { /** * Specifies the enqueueServerProperties property: Defines the SAP Enqueue Server properties.. - * + * * @param enqueueServerProperties Defines the SAP Enqueue Server properties. * @return the next definition stage. */ WithCreate withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties); } - /** The stage of the SapCentralServerInstance definition allowing to specify gatewayServerProperties. */ + + /** + * The stage of the SapCentralServerInstance definition allowing to specify gatewayServerProperties. + */ interface WithGatewayServerProperties { /** * Specifies the gatewayServerProperties property: Defines the SAP Gateway Server properties.. - * + * * @param gatewayServerProperties Defines the SAP Gateway Server properties. * @return the next definition stage. */ WithCreate withGatewayServerProperties(GatewayServerProperties gatewayServerProperties); } + /** * The stage of the SapCentralServerInstance definition allowing to specify enqueueReplicationServerProperties. */ @@ -296,7 +319,7 @@ interface WithEnqueueReplicationServerProperties { /** * Specifies the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server * (ERS) properties.. - * + * * @param enqueueReplicationServerProperties Defines the SAP Enqueue Replication Server (ERS) properties. * @return the next definition stage. */ @@ -304,53 +327,62 @@ WithCreate withEnqueueReplicationServerProperties( EnqueueReplicationServerProperties enqueueReplicationServerProperties); } } + /** * Begins update for the SapCentralServerInstance resource. - * + * * @return the stage of resource update. */ SapCentralServerInstance.Update update(); - /** The template for SapCentralServerInstance update. */ + /** + * The template for SapCentralServerInstance update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ SapCentralServerInstance apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ SapCentralServerInstance apply(Context context); } - /** The SapCentralServerInstance update stages. */ + + /** + * The SapCentralServerInstance update stages. + */ interface UpdateStages { - /** The stage of the SapCentralServerInstance update allowing to specify tags. */ + /** + * The stage of the SapCentralServerInstance update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Gets or sets the Resource tags.. - * + * * @param tags Gets or sets the Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SapCentralServerInstance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -358,7 +390,7 @@ interface WithTags { /** * Starts the SAP Central Services Instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -367,7 +399,7 @@ interface WithTags { /** * Starts the SAP Central Services Instance. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -378,7 +410,7 @@ interface WithTags { /** * Stops the SAP Central Services Instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -387,7 +419,7 @@ interface WithTags { /** * Stops the SAP Central Services Instance. - * + * * @param body SAP Central Services instance stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfiguration.java index ad5977b7ef1b..952aa0be1569 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfiguration.java @@ -5,33 +5,109 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The SAP Configuration. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "configurationType", - defaultImpl = SapConfiguration.class) -@JsonTypeName("SapConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Discovery", value = DiscoveryConfiguration.class), - @JsonSubTypes.Type(name = "Deployment", value = DeploymentConfiguration.class), - @JsonSubTypes.Type(name = "DeploymentWithOSConfig", value = DeploymentWithOSConfiguration.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SAP Configuration. + */ @Immutable -public class SapConfiguration { - /** Creates an instance of SapConfiguration class. */ +public class SapConfiguration implements JsonSerializable { + /* + * The configuration Type. + */ + private SapConfigurationType configurationType = SapConfigurationType.fromString("SapConfiguration"); + + /** + * Creates an instance of SapConfiguration class. + */ public SapConfiguration() { } + /** + * Get the configurationType property: The configuration Type. + * + * @return the configurationType value. + */ + public SapConfigurationType configurationType() { + return this.configurationType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SapConfiguration. + */ + public static SapConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("configurationType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Discovery".equals(discriminatorValue)) { + return DiscoveryConfiguration.fromJson(readerToUse.reset()); + } else if ("Deployment".equals(discriminatorValue)) { + return DeploymentConfiguration.fromJson(readerToUse.reset()); + } else if ("DeploymentWithOSConfig".equals(discriminatorValue)) { + return DeploymentWithOSConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SapConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapConfiguration deserializedSapConfiguration = new SapConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedSapConfiguration.configurationType + = SapConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfigurationType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfigurationType.java index ebaa1e77fd87..330a133d5f54 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfigurationType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfigurationType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The configuration Type. */ +/** + * The configuration Type. + */ public final class SapConfigurationType extends ExpandableStringEnum { - /** Static value Deployment for SapConfigurationType. */ + /** + * Static value Deployment for SapConfigurationType. + */ public static final SapConfigurationType DEPLOYMENT = fromString("Deployment"); - /** Static value Discovery for SapConfigurationType. */ + /** + * Static value Discovery for SapConfigurationType. + */ public static final SapConfigurationType DISCOVERY = fromString("Discovery"); - /** Static value DeploymentWithOSConfig for SapConfigurationType. */ + /** + * Static value DeploymentWithOSConfig for SapConfigurationType. + */ public static final SapConfigurationType DEPLOYMENT_WITH_OSCONFIG = fromString("DeploymentWithOSConfig"); /** * Creates a new instance of SapConfigurationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SapConfigurationType() { /** * Creates or finds a SapConfigurationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapConfigurationType. */ - @JsonCreator public static SapConfigurationType fromString(String name) { return fromString(name, SapConfigurationType.class); } /** * Gets known SapConfigurationType values. - * + * * @return known SapConfigurationType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstance.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstance.java index 3b5d8ce3812d..5f793305b354 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstance.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstance.java @@ -11,60 +11,62 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of SapDatabaseInstance. */ +/** + * An immutable client-side representation of SapDatabaseInstance. + */ public interface SapDatabaseInstance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the subnet property: Database subnet. - * + * * @return the subnet value. */ String subnet(); /** * Gets the databaseSid property: Database SID name. - * + * * @return the databaseSid value. */ String databaseSid(); @@ -72,14 +74,14 @@ public interface SapDatabaseInstance { /** * Gets the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL * Server. - * + * * @return the databaseType value. */ String databaseType(); /** * Gets the ipAddress property: Database IP Address. - * + * * @return the ipAddress value. */ String ipAddress(); @@ -87,84 +89,91 @@ public interface SapDatabaseInstance { /** * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database * Virtual Machines. - * + * * @return the loadBalancerDetails value. */ LoadBalancerDetails loadBalancerDetails(); /** * Gets the vmDetails property: The list of virtual machines corresponding to the Database resource. - * + * * @return the vmDetails value. */ List vmDetails(); /** * Gets the status property: Defines the SAP Instance status. - * + * * @return the status value. */ SapVirtualInstanceStatus status(); /** * Gets the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ SapVirtualInstanceProvisioningState provisioningState(); /** * Gets the errors property: Defines the errors related to Database resource. - * + * * @return the errors value. */ SapVirtualInstanceError errors(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner object. - * + * * @return the inner object. */ SapDatabaseInstanceInner innerModel(); - /** The entirety of the SapDatabaseInstance definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithParentResource, - DefinitionStages.WithCreate { + /** + * The entirety of the SapDatabaseInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The SapDatabaseInstance definition stages. */ + + /** + * The SapDatabaseInstance definition stages. + */ interface DefinitionStages { - /** The first stage of the SapDatabaseInstance definition. */ + /** + * The first stage of the SapDatabaseInstance definition. + */ interface Blank extends WithLocation { } - /** The stage of the SapDatabaseInstance definition allowing to specify location. */ + + /** + * The stage of the SapDatabaseInstance definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -172,23 +181,27 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithParentResource withRegion(String location); } - /** The stage of the SapDatabaseInstance definition allowing to specify parent resource. */ + + /** + * The stage of the SapDatabaseInstance definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, sapVirtualInstanceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @return the next definition stage. */ WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); } + /** * The stage of the SapDatabaseInstance 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. @@ -196,77 +209,89 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ SapDatabaseInstance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SapDatabaseInstance create(Context context); } - /** The stage of the SapDatabaseInstance definition allowing to specify tags. */ + + /** + * The stage of the SapDatabaseInstance definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } } + /** * Begins update for the SapDatabaseInstance resource. - * + * * @return the stage of resource update. */ SapDatabaseInstance.Update update(); - /** The template for SapDatabaseInstance update. */ + /** + * The template for SapDatabaseInstance update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ SapDatabaseInstance apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ SapDatabaseInstance apply(Context context); } - /** The SapDatabaseInstance update stages. */ + + /** + * The SapDatabaseInstance update stages. + */ interface UpdateStages { - /** The stage of the SapDatabaseInstance update allowing to specify tags. */ + /** + * The stage of the SapDatabaseInstance update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Gets or sets the Resource tags.. - * + * * @param tags Gets or sets the Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SapDatabaseInstance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -274,7 +299,7 @@ interface WithTags { /** * Starts the database instance of the SAP system. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -283,7 +308,7 @@ interface WithTags { /** * Starts the database instance of the SAP system. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -294,7 +319,7 @@ interface WithTags { /** * Stops the database instance of the SAP system. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -303,7 +328,7 @@ interface WithTags { /** * Stops the database instance of the SAP system. - * + * * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstanceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstanceList.java index e612bda04761..11005cf6c66c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstanceList.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstanceList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the collection of SAP Database Instances. */ +/** + * Defines the collection of SAP Database Instances. + */ @Fluent -public final class SapDatabaseInstanceList { +public final class SapDatabaseInstanceList implements JsonSerializable { /* * Gets the list of SAP Database instances. */ - @JsonProperty(value = "value") private List value; /* * Gets the value of next link. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of SapDatabaseInstanceList class. */ + /** + * Creates an instance of SapDatabaseInstanceList class. + */ public SapDatabaseInstanceList() { } /** * Get the value property: Gets the list of SAP Database instances. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: Gets the list of SAP Database instances. - * + * * @param value the value value to set. * @return the SapDatabaseInstanceList object itself. */ @@ -50,7 +56,7 @@ public SapDatabaseInstanceList withValue(List value) { /** * Get the nextLink property: Gets the value of next link. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: Gets the value of next link. - * + * * @param nextLink the nextLink value to set. * @return the SapDatabaseInstanceList object itself. */ @@ -70,7 +76,7 @@ public SapDatabaseInstanceList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDatabaseInstanceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDatabaseInstanceList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapDatabaseInstanceList. + */ + public static SapDatabaseInstanceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDatabaseInstanceList deserializedSapDatabaseInstanceList = new SapDatabaseInstanceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SapDatabaseInstanceInner.fromJson(reader1)); + deserializedSapDatabaseInstanceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSapDatabaseInstanceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapDatabaseInstanceList; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstances.java index 2ffd19a5fdbe..990373adc324 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstances.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstances.java @@ -8,31 +8,33 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SapDatabaseInstances. */ +/** + * Resource collection API of SapDatabaseInstances. + */ public interface SapDatabaseInstances { /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the SAP Database Instance resource along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + Response getWithResponse(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context); /** * Gets the SAP Database Instance resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -43,11 +45,11 @@ Response getWithResponse( /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -58,23 +60,23 @@ Response getWithResponse( /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult delete( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, + Context context); /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,7 +88,7 @@ OperationStatusResult delete( /** * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -99,57 +101,57 @@ OperationStatusResult delete( /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Starts the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult startInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + OperationStatusResult startInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, Context context); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName); /** * Stops the database instance of the SAP system. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work - * correctly. + * correctly. * @param body Stop request for the database instance of the SAP system. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,16 +159,12 @@ OperationStatusResult stopInstance( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stopInstance( - String resourceGroupName, - String sapVirtualInstanceName, - String databaseInstanceName, - StopRequest body, - Context context); + OperationStatusResult stopInstance(String resourceGroupName, String sapVirtualInstanceName, + String databaseInstanceName, StopRequest body, Context context); /** * Gets the SAP Database Instance resource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -177,7 +175,7 @@ OperationStatusResult stopInstance( /** * Gets the SAP Database Instance resource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -190,7 +188,7 @@ OperationStatusResult stopInstance( /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -202,7 +200,7 @@ OperationStatusResult stopInstance( /** * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -214,7 +212,7 @@ OperationStatusResult stopInstance( /** * Begins definition for a new SapDatabaseInstance resource. - * + * * @param name resource name. * @return the first stage of the new SapDatabaseInstance definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseScaleMethod.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseScaleMethod.java index 10f6e507480b..86dbb4390411 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseScaleMethod.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseScaleMethod.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The database scale method. */ +/** + * The database scale method. + */ public final class SapDatabaseScaleMethod extends ExpandableStringEnum { - /** Static value ScaleUp for SapDatabaseScaleMethod. */ + /** + * Static value ScaleUp for SapDatabaseScaleMethod. + */ public static final SapDatabaseScaleMethod SCALE_UP = fromString("ScaleUp"); /** * Creates a new instance of SapDatabaseScaleMethod value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public SapDatabaseScaleMethod() { /** * Creates or finds a SapDatabaseScaleMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapDatabaseScaleMethod. */ - @JsonCreator public static SapDatabaseScaleMethod fromString(String name) { return fromString(name, SapDatabaseScaleMethod.class); } /** * Gets known SapDatabaseScaleMethod values. - * + * * @return known SapDatabaseScaleMethod values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseType.java index 308fddb44a26..b10ec37e7310 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the supported SAP Database types. */ +/** + * Defines the supported SAP Database types. + */ public final class SapDatabaseType extends ExpandableStringEnum { - /** Static value HANA for SapDatabaseType. */ + /** + * Static value HANA for SapDatabaseType. + */ public static final SapDatabaseType HANA = fromString("HANA"); - /** Static value DB2 for SapDatabaseType. */ + /** + * Static value DB2 for SapDatabaseType. + */ public static final SapDatabaseType DB2 = fromString("DB2"); /** * Creates a new instance of SapDatabaseType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SapDatabaseType() { /** * Creates or finds a SapDatabaseType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapDatabaseType. */ - @JsonCreator public static SapDatabaseType fromString(String name) { return fromString(name, SapDatabaseType.class); } /** * Gets known SapDatabaseType values. - * + * * @return known SapDatabaseType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDeploymentType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDeploymentType.java index 5cdd76535b01..6be61a650e0f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDeploymentType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDeploymentType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of SAP deployment, single server or Three tier. */ +/** + * The type of SAP deployment, single server or Three tier. + */ public final class SapDeploymentType extends ExpandableStringEnum { - /** Static value SingleServer for SapDeploymentType. */ + /** + * Static value SingleServer for SapDeploymentType. + */ public static final SapDeploymentType SINGLE_SERVER = fromString("SingleServer"); - /** Static value ThreeTier for SapDeploymentType. */ + /** + * Static value ThreeTier for SapDeploymentType. + */ public static final SapDeploymentType THREE_TIER = fromString("ThreeTier"); /** * Creates a new instance of SapDeploymentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SapDeploymentType() { /** * Creates or finds a SapDeploymentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapDeploymentType. */ - @JsonCreator public static SapDeploymentType fromString(String name) { return fromString(name, SapDeploymentType.class); } /** * Gets known SapDeploymentType values. - * + * * @return known SapDeploymentType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfiguration.java index 521e013775d5..2fcf8736ecef 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfiguration.java @@ -5,33 +5,37 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail for a volume type. */ @Fluent -public final class SapDiskConfiguration { +public final class SapDiskConfiguration implements JsonSerializable { /* * The recommended disk details for a given VM Sku. */ - @JsonProperty(value = "recommendedConfiguration") private DiskVolumeConfiguration recommendedConfiguration; /* * The list of supported disks for a given VM Sku. */ - @JsonProperty(value = "supportedConfigurations") private List supportedConfigurations; - /** Creates an instance of SapDiskConfiguration class. */ + /** + * Creates an instance of SapDiskConfiguration class. + */ public SapDiskConfiguration() { } /** * Get the recommendedConfiguration property: The recommended disk details for a given VM Sku. - * + * * @return the recommendedConfiguration value. */ public DiskVolumeConfiguration recommendedConfiguration() { @@ -40,7 +44,7 @@ public DiskVolumeConfiguration recommendedConfiguration() { /** * Set the recommendedConfiguration property: The recommended disk details for a given VM Sku. - * + * * @param recommendedConfiguration the recommendedConfiguration value to set. * @return the SapDiskConfiguration object itself. */ @@ -51,7 +55,7 @@ public SapDiskConfiguration withRecommendedConfiguration(DiskVolumeConfiguration /** * Get the supportedConfigurations property: The list of supported disks for a given VM Sku. - * + * * @return the supportedConfigurations value. */ public List supportedConfigurations() { @@ -60,7 +64,7 @@ public List supportedConfigurations() { /** * Set the supportedConfigurations property: The list of supported disks for a given VM Sku. - * + * * @param supportedConfigurations the supportedConfigurations value to set. * @return the SapDiskConfiguration object itself. */ @@ -71,7 +75,7 @@ public SapDiskConfiguration withSupportedConfigurations(List suppor /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -82,4 +86,47 @@ public void validate() { supportedConfigurations().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recommendedConfiguration", this.recommendedConfiguration); + jsonWriter.writeArrayField("supportedConfigurations", this.supportedConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDiskConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDiskConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapDiskConfiguration. + */ + public static SapDiskConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDiskConfiguration deserializedSapDiskConfiguration = new SapDiskConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recommendedConfiguration".equals(fieldName)) { + deserializedSapDiskConfiguration.recommendedConfiguration + = DiskVolumeConfiguration.fromJson(reader); + } else if ("supportedConfigurations".equals(fieldName)) { + List supportedConfigurations + = reader.readArray(reader1 -> DiskDetails.fromJson(reader1)); + deserializedSapDiskConfiguration.supportedConfigurations = supportedConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedSapDiskConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsRequest.java index 537b7236b39d..a936560e382d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsRequest.java @@ -6,54 +6,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP request to get list of disk configurations. */ +/** + * The SAP request to get list of disk configurations. + */ @Fluent -public final class SapDiskConfigurationsRequest { +public final class SapDiskConfigurationsRequest implements JsonSerializable { /* * The geo-location where the SAP resources will be created. */ - @JsonProperty(value = "appLocation", required = true) private String appLocation; /* * Defines the environment type - Production/Non Production. */ - @JsonProperty(value = "environment", required = true) private SapEnvironmentType environment; /* * Defines the SAP Product type. */ - @JsonProperty(value = "sapProduct", required = true) private SapProductType sapProduct; /* * The database type. Eg: HANA, DB2, etc */ - @JsonProperty(value = "databaseType", required = true) private SapDatabaseType databaseType; /* * The deployment type. Eg: SingleServer/ThreeTier */ - @JsonProperty(value = "deploymentType", required = true) private SapDeploymentType deploymentType; /* * The VM SKU for database instance. */ - @JsonProperty(value = "dbVmSku", required = true) private String dbVmSku; - /** Creates an instance of SapDiskConfigurationsRequest class. */ + /** + * Creates an instance of SapDiskConfigurationsRequest class. + */ public SapDiskConfigurationsRequest() { } /** * Get the appLocation property: The geo-location where the SAP resources will be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -62,7 +64,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the SAP resources will be created. - * + * * @param appLocation the appLocation value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -73,7 +75,7 @@ public SapDiskConfigurationsRequest withAppLocation(String appLocation) { /** * Get the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ public SapEnvironmentType environment() { @@ -82,7 +84,7 @@ public SapEnvironmentType environment() { /** * Set the environment property: Defines the environment type - Production/Non Production. - * + * * @param environment the environment value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -93,7 +95,7 @@ public SapDiskConfigurationsRequest withEnvironment(SapEnvironmentType environme /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -102,7 +104,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -113,7 +115,7 @@ public SapDiskConfigurationsRequest withSapProduct(SapProductType sapProduct) { /** * Get the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -122,7 +124,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @param databaseType the databaseType value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -133,7 +135,7 @@ public SapDiskConfigurationsRequest withDatabaseType(SapDatabaseType databaseTyp /** * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @return the deploymentType value. */ public SapDeploymentType deploymentType() { @@ -142,7 +144,7 @@ public SapDeploymentType deploymentType() { /** * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @param deploymentType the deploymentType value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -153,7 +155,7 @@ public SapDiskConfigurationsRequest withDeploymentType(SapDeploymentType deploym /** * Get the dbVmSku property: The VM SKU for database instance. - * + * * @return the dbVmSku value. */ public String dbVmSku() { @@ -162,7 +164,7 @@ public String dbVmSku() { /** * Set the dbVmSku property: The VM SKU for database instance. - * + * * @param dbVmSku the dbVmSku value to set. * @return the SapDiskConfigurationsRequest object itself. */ @@ -173,47 +175,97 @@ public SapDiskConfigurationsRequest withDbVmSku(String dbVmSku) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (appLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appLocation in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appLocation in model SapDiskConfigurationsRequest")); } if (environment() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environment in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property environment in model SapDiskConfigurationsRequest")); } if (sapProduct() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapProduct in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapProduct in model SapDiskConfigurationsRequest")); } if (databaseType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseType in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseType in model SapDiskConfigurationsRequest")); } if (deploymentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deploymentType in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentType in model SapDiskConfigurationsRequest")); } if (dbVmSku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property dbVmSku in model SapDiskConfigurationsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dbVmSku in model SapDiskConfigurationsRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(SapDiskConfigurationsRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); + jsonWriter.writeStringField("sapProduct", this.sapProduct == null ? null : this.sapProduct.toString()); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("dbVmSku", this.dbVmSku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapDiskConfigurationsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapDiskConfigurationsRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapDiskConfigurationsRequest. + */ + public static SapDiskConfigurationsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapDiskConfigurationsRequest deserializedSapDiskConfigurationsRequest = new SapDiskConfigurationsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appLocation".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.appLocation = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.environment + = SapEnvironmentType.fromString(reader.getString()); + } else if ("sapProduct".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.sapProduct = SapProductType.fromString(reader.getString()); + } else if ("databaseType".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.databaseType + = SapDatabaseType.fromString(reader.getString()); + } else if ("deploymentType".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("dbVmSku".equals(fieldName)) { + deserializedSapDiskConfigurationsRequest.dbVmSku = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapDiskConfigurationsRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsResult.java index 3f115f77a0af..2f9cbad42587 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsResult.java @@ -7,19 +7,21 @@ import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; import java.util.Map; -/** An immutable client-side representation of SapDiskConfigurationsResult. */ +/** + * An immutable client-side representation of SapDiskConfigurationsResult. + */ public interface SapDiskConfigurationsResult { /** * Gets the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. - * + * * @return the volumeConfigurations value. */ Map volumeConfigurations(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner object. - * + * * @return the inner object. */ SapDiskConfigurationsResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapEnvironmentType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapEnvironmentType.java index 931424be0520..6b8bf0041670 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapEnvironmentType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapEnvironmentType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the environment type - Production/Non Production. */ +/** + * Defines the environment type - Production/Non Production. + */ public final class SapEnvironmentType extends ExpandableStringEnum { - /** Static value NonProd for SapEnvironmentType. */ + /** + * Static value NonProd for SapEnvironmentType. + */ public static final SapEnvironmentType NON_PROD = fromString("NonProd"); - /** Static value Prod for SapEnvironmentType. */ + /** + * Static value Prod for SapEnvironmentType. + */ public static final SapEnvironmentType PROD = fromString("Prod"); /** * Creates a new instance of SapEnvironmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SapEnvironmentType() { /** * Creates or finds a SapEnvironmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapEnvironmentType. */ - @JsonCreator public static SapEnvironmentType fromString(String name) { return fromString(name, SapEnvironmentType.class); } /** * Gets known SapEnvironmentType values. - * + * * @return known SapEnvironmentType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHealthState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHealthState.java index 93b808465b12..8ab08b74a539 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHealthState.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHealthState.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the health of SAP Instances. */ +/** + * Defines the health of SAP Instances. + */ public final class SapHealthState extends ExpandableStringEnum { - /** Static value Unknown for SapHealthState. */ + /** + * Static value Unknown for SapHealthState. + */ public static final SapHealthState UNKNOWN = fromString("Unknown"); - /** Static value Healthy for SapHealthState. */ + /** + * Static value Healthy for SapHealthState. + */ public static final SapHealthState HEALTHY = fromString("Healthy"); - /** Static value Unhealthy for SapHealthState. */ + /** + * Static value Unhealthy for SapHealthState. + */ public static final SapHealthState UNHEALTHY = fromString("Unhealthy"); - /** Static value Degraded for SapHealthState. */ + /** + * Static value Degraded for SapHealthState. + */ public static final SapHealthState DEGRADED = fromString("Degraded"); /** * Creates a new instance of SapHealthState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public SapHealthState() { /** * Creates or finds a SapHealthState from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapHealthState. */ - @JsonCreator public static SapHealthState fromString(String name) { return fromString(name, SapHealthState.class); } /** * Gets known SapHealthState values. - * + * * @return known SapHealthState values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHighAvailabilityType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHighAvailabilityType.java index 218f12c948cf..c8f93b1a7a6d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHighAvailabilityType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHighAvailabilityType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The high availability type (AvailabilitySet or AvailabilityZone). */ +/** + * The high availability type (AvailabilitySet or AvailabilityZone). + */ public final class SapHighAvailabilityType extends ExpandableStringEnum { - /** Static value AvailabilitySet for SapHighAvailabilityType. */ + /** + * Static value AvailabilitySet for SapHighAvailabilityType. + */ public static final SapHighAvailabilityType AVAILABILITY_SET = fromString("AvailabilitySet"); - /** Static value AvailabilityZone for SapHighAvailabilityType. */ + /** + * Static value AvailabilityZone for SapHighAvailabilityType. + */ public static final SapHighAvailabilityType AVAILABILITY_ZONE = fromString("AvailabilityZone"); /** * Creates a new instance of SapHighAvailabilityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SapHighAvailabilityType() { /** * Creates or finds a SapHighAvailabilityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapHighAvailabilityType. */ - @JsonCreator public static SapHighAvailabilityType fromString(String name) { return fromString(name, SapHighAvailabilityType.class); } /** * Gets known SapHighAvailabilityType values. - * + * * @return known SapHighAvailabilityType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapInstallWithoutOSConfigSoftwareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapInstallWithoutOSConfigSoftwareConfiguration.java index 24c1e7397442..d2155f62b797 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapInstallWithoutOSConfigSoftwareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapInstallWithoutOSConfigSoftwareConfiguration.java @@ -6,46 +6,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The SAP Software configuration Input when the software is to be installed by service without OS Configurations. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") -@JsonTypeName("SAPInstallWithoutOSConfig") +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SAP Software configuration Input when the software is to be installed by service without OS Configurations. + */ @Fluent public final class SapInstallWithoutOSConfigSoftwareConfiguration extends SoftwareConfiguration { + /* + * The SAP software installation Type. + */ + private SapSoftwareInstallationType softwareInstallationType + = SapSoftwareInstallationType.SAPINSTALL_WITHOUT_OSCONFIG; + /* * The URL to the SAP Build of Materials(BOM) file. */ - @JsonProperty(value = "bomUrl", required = true) private String bomUrl; /* * The SAP bits storage account id. */ - @JsonProperty(value = "sapBitsStorageAccountId", required = true) private String sapBitsStorageAccountId; /* * The software version to install. */ - @JsonProperty(value = "softwareVersion", required = true) private String softwareVersion; /* * Gets or sets the HA software configuration. */ - @JsonProperty(value = "highAvailabilitySoftwareConfiguration") private HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration; - /** Creates an instance of SapInstallWithoutOSConfigSoftwareConfiguration class. */ + /** + * Creates an instance of SapInstallWithoutOSConfigSoftwareConfiguration class. + */ public SapInstallWithoutOSConfigSoftwareConfiguration() { } + /** + * Get the softwareInstallationType property: The SAP software installation Type. + * + * @return the softwareInstallationType value. + */ + @Override + public SapSoftwareInstallationType softwareInstallationType() { + return this.softwareInstallationType; + } + /** * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. - * + * * @return the bomUrl value. */ public String bomUrl() { @@ -54,7 +69,7 @@ public String bomUrl() { /** * Set the bomUrl property: The URL to the SAP Build of Materials(BOM) file. - * + * * @param bomUrl the bomUrl value to set. * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. */ @@ -65,7 +80,7 @@ public SapInstallWithoutOSConfigSoftwareConfiguration withBomUrl(String bomUrl) /** * Get the sapBitsStorageAccountId property: The SAP bits storage account id. - * + * * @return the sapBitsStorageAccountId value. */ public String sapBitsStorageAccountId() { @@ -74,7 +89,7 @@ public String sapBitsStorageAccountId() { /** * Set the sapBitsStorageAccountId property: The SAP bits storage account id. - * + * * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. */ @@ -85,7 +100,7 @@ public SapInstallWithoutOSConfigSoftwareConfiguration withSapBitsStorageAccountI /** * Get the softwareVersion property: The software version to install. - * + * * @return the softwareVersion value. */ public String softwareVersion() { @@ -94,7 +109,7 @@ public String softwareVersion() { /** * Set the softwareVersion property: The software version to install. - * + * * @param softwareVersion the softwareVersion value to set. * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. */ @@ -105,7 +120,7 @@ public SapInstallWithoutOSConfigSoftwareConfiguration withSoftwareVersion(String /** * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. - * + * * @return the highAvailabilitySoftwareConfiguration value. */ public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { @@ -114,7 +129,7 @@ public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfigurati /** * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. - * + * * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. */ @@ -126,31 +141,26 @@ public SapInstallWithoutOSConfigSoftwareConfiguration withHighAvailabilitySoftwa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (bomUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property bomUrl in model SapInstallWithoutOSConfigSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bomUrl in model SapInstallWithoutOSConfigSoftwareConfiguration")); } if (sapBitsStorageAccountId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapBitsStorageAccountId in model" - + " SapInstallWithoutOSConfigSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model SapInstallWithoutOSConfigSoftwareConfiguration")); } if (softwareVersion() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property softwareVersion in model" - + " SapInstallWithoutOSConfigSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property softwareVersion in model SapInstallWithoutOSConfigSoftwareConfiguration")); } if (highAvailabilitySoftwareConfiguration() != null) { highAvailabilitySoftwareConfiguration().validate(); @@ -158,4 +168,58 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SapInstallWithoutOSConfigSoftwareConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bomUrl", this.bomUrl); + jsonWriter.writeStringField("sapBitsStorageAccountId", this.sapBitsStorageAccountId); + jsonWriter.writeStringField("softwareVersion", this.softwareVersion); + jsonWriter.writeStringField("softwareInstallationType", + this.softwareInstallationType == null ? null : this.softwareInstallationType.toString()); + jsonWriter.writeJsonField("highAvailabilitySoftwareConfiguration", this.highAvailabilitySoftwareConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapInstallWithoutOSConfigSoftwareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapInstallWithoutOSConfigSoftwareConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapInstallWithoutOSConfigSoftwareConfiguration. + */ + public static SapInstallWithoutOSConfigSoftwareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapInstallWithoutOSConfigSoftwareConfiguration deserializedSapInstallWithoutOSConfigSoftwareConfiguration + = new SapInstallWithoutOSConfigSoftwareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bomUrl".equals(fieldName)) { + deserializedSapInstallWithoutOSConfigSoftwareConfiguration.bomUrl = reader.getString(); + } else if ("sapBitsStorageAccountId".equals(fieldName)) { + deserializedSapInstallWithoutOSConfigSoftwareConfiguration.sapBitsStorageAccountId + = reader.getString(); + } else if ("softwareVersion".equals(fieldName)) { + deserializedSapInstallWithoutOSConfigSoftwareConfiguration.softwareVersion = reader.getString(); + } else if ("softwareInstallationType".equals(fieldName)) { + deserializedSapInstallWithoutOSConfigSoftwareConfiguration.softwareInstallationType + = SapSoftwareInstallationType.fromString(reader.getString()); + } else if ("highAvailabilitySoftwareConfiguration".equals(fieldName)) { + deserializedSapInstallWithoutOSConfigSoftwareConfiguration.highAvailabilitySoftwareConfiguration + = HighAvailabilitySoftwareConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapInstallWithoutOSConfigSoftwareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitor.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitor.java index 47081c747e4a..c458f8618c3a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitor.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitor.java @@ -8,46 +8,48 @@ import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; import java.util.List; -/** An immutable client-side representation of SapLandscapeMonitor. */ +/** + * An immutable client-side representation of SapLandscapeMonitor. + */ public interface SapLandscapeMonitor { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: State of provisioning of the SAP monitor. - * + * * @return the provisioningState value. */ SapLandscapeMonitorProvisioningState provisioningState(); /** * Gets the grouping property: Gets or sets the SID groupings by landscape and Environment. - * + * * @return the grouping value. */ SapLandscapeMonitorPropertiesGrouping grouping(); @@ -55,14 +57,14 @@ public interface SapLandscapeMonitor { /** * Gets the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor * Dashboard. - * + * * @return the topMetricsThresholds value. */ List topMetricsThresholds(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner object. - * + * * @return the inner object. */ SapLandscapeMonitorInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorListResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorListResult.java index 5d518ac98a4f..e1de5d67f601 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorListResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorListResult.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorListResultInner; import java.util.List; -/** An immutable client-side representation of SapLandscapeMonitorListResult. */ +/** + * An immutable client-side representation of SapLandscapeMonitorListResult. + */ public interface SapLandscapeMonitorListResult { /** * Gets the value property: The list of Sap Landscape Monitor configuration. - * + * * @return the value value. */ List value(); /** * Gets the nextLink property: The URL to get the next set of SAP Landscape Monitor Dashboard. - * + * * @return the nextLink value. */ String nextLink(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorListResultInner object. - * + * * @return the inner object. */ SapLandscapeMonitorListResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorMetricThresholds.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorMetricThresholds.java index 1f33f2263563..54e983daaa23 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorMetricThresholds.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorMetricThresholds.java @@ -5,42 +5,47 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Gets or sets the Threshold Values for Top Metrics Health. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the Threshold Values for Top Metrics Health. + */ @Fluent -public final class SapLandscapeMonitorMetricThresholds { +public final class SapLandscapeMonitorMetricThresholds + implements JsonSerializable { /* * Gets or sets the name of the threshold. */ - @JsonProperty(value = "name") private String name; /* * Gets or sets the threshold value for Green. */ - @JsonProperty(value = "green") private Float green; /* * Gets or sets the threshold value for Yellow. */ - @JsonProperty(value = "yellow") private Float yellow; /* * Gets or sets the threshold value for Red. */ - @JsonProperty(value = "red") private Float red; - /** Creates an instance of SapLandscapeMonitorMetricThresholds class. */ + /** + * Creates an instance of SapLandscapeMonitorMetricThresholds class. + */ public SapLandscapeMonitorMetricThresholds() { } /** * Get the name property: Gets or sets the name of the threshold. - * + * * @return the name value. */ public String name() { @@ -49,7 +54,7 @@ public String name() { /** * Set the name property: Gets or sets the name of the threshold. - * + * * @param name the name value to set. * @return the SapLandscapeMonitorMetricThresholds object itself. */ @@ -60,7 +65,7 @@ public SapLandscapeMonitorMetricThresholds withName(String name) { /** * Get the green property: Gets or sets the threshold value for Green. - * + * * @return the green value. */ public Float green() { @@ -69,7 +74,7 @@ public Float green() { /** * Set the green property: Gets or sets the threshold value for Green. - * + * * @param green the green value to set. * @return the SapLandscapeMonitorMetricThresholds object itself. */ @@ -80,7 +85,7 @@ public SapLandscapeMonitorMetricThresholds withGreen(Float green) { /** * Get the yellow property: Gets or sets the threshold value for Yellow. - * + * * @return the yellow value. */ public Float yellow() { @@ -89,7 +94,7 @@ public Float yellow() { /** * Set the yellow property: Gets or sets the threshold value for Yellow. - * + * * @param yellow the yellow value to set. * @return the SapLandscapeMonitorMetricThresholds object itself. */ @@ -100,7 +105,7 @@ public SapLandscapeMonitorMetricThresholds withYellow(Float yellow) { /** * Get the red property: Gets or sets the threshold value for Red. - * + * * @return the red value. */ public Float red() { @@ -109,7 +114,7 @@ public Float red() { /** * Set the red property: Gets or sets the threshold value for Red. - * + * * @param red the red value to set. * @return the SapLandscapeMonitorMetricThresholds object itself. */ @@ -120,9 +125,55 @@ public SapLandscapeMonitorMetricThresholds withRed(Float red) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("green", this.green); + jsonWriter.writeNumberField("yellow", this.yellow); + jsonWriter.writeNumberField("red", this.red); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorMetricThresholds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorMetricThresholds if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorMetricThresholds. + */ + public static SapLandscapeMonitorMetricThresholds fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorMetricThresholds deserializedSapLandscapeMonitorMetricThresholds + = new SapLandscapeMonitorMetricThresholds(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSapLandscapeMonitorMetricThresholds.name = reader.getString(); + } else if ("green".equals(fieldName)) { + deserializedSapLandscapeMonitorMetricThresholds.green = reader.getNullable(JsonReader::getFloat); + } else if ("yellow".equals(fieldName)) { + deserializedSapLandscapeMonitorMetricThresholds.yellow = reader.getNullable(JsonReader::getFloat); + } else if ("red".equals(fieldName)) { + deserializedSapLandscapeMonitorMetricThresholds.red = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorMetricThresholds; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorPropertiesGrouping.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorPropertiesGrouping.java index 5874142cbbe7..6f0f16bf145e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorPropertiesGrouping.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorPropertiesGrouping.java @@ -5,31 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Gets or sets the SID groupings by landscape and Environment. */ +/** + * Gets or sets the SID groupings by landscape and Environment. + */ @Fluent -public final class SapLandscapeMonitorPropertiesGrouping { +public final class SapLandscapeMonitorPropertiesGrouping + implements JsonSerializable { /* * Gets or sets the list of landscape to SID mappings. */ - @JsonProperty(value = "landscape") private List landscape; /* * Gets or sets the list of Sap Applications to SID mappings. */ - @JsonProperty(value = "sapApplication") private List sapApplication; - /** Creates an instance of SapLandscapeMonitorPropertiesGrouping class. */ + /** + * Creates an instance of SapLandscapeMonitorPropertiesGrouping class. + */ public SapLandscapeMonitorPropertiesGrouping() { } /** * Get the landscape property: Gets or sets the list of landscape to SID mappings. - * + * * @return the landscape value. */ public List landscape() { @@ -38,7 +45,7 @@ public List landscape() { /** * Set the landscape property: Gets or sets the list of landscape to SID mappings. - * + * * @param landscape the landscape value to set. * @return the SapLandscapeMonitorPropertiesGrouping object itself. */ @@ -49,7 +56,7 @@ public SapLandscapeMonitorPropertiesGrouping withLandscape(List sapApplication() { @@ -58,19 +65,19 @@ public List sapApplication() { /** * Set the sapApplication property: Gets or sets the list of Sap Applications to SID mappings. - * + * * @param sapApplication the sapApplication value to set. * @return the SapLandscapeMonitorPropertiesGrouping object itself. */ - public SapLandscapeMonitorPropertiesGrouping withSapApplication( - List sapApplication) { + public SapLandscapeMonitorPropertiesGrouping + withSapApplication(List sapApplication) { this.sapApplication = sapApplication; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -81,4 +88,49 @@ public void validate() { sapApplication().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("landscape", this.landscape, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sapApplication", this.sapApplication, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorPropertiesGrouping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorPropertiesGrouping if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorPropertiesGrouping. + */ + public static SapLandscapeMonitorPropertiesGrouping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorPropertiesGrouping deserializedSapLandscapeMonitorPropertiesGrouping + = new SapLandscapeMonitorPropertiesGrouping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("landscape".equals(fieldName)) { + List landscape + = reader.readArray(reader1 -> SapLandscapeMonitorSidMapping.fromJson(reader1)); + deserializedSapLandscapeMonitorPropertiesGrouping.landscape = landscape; + } else if ("sapApplication".equals(fieldName)) { + List sapApplication + = reader.readArray(reader1 -> SapLandscapeMonitorSidMapping.fromJson(reader1)); + deserializedSapLandscapeMonitorPropertiesGrouping.sapApplication = sapApplication; + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorPropertiesGrouping; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorProvisioningState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorProvisioningState.java index 194c23e6e2f4..06c97f412ae8 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorProvisioningState.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorProvisioningState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of provisioning of the SAP monitor. */ +/** + * State of provisioning of the SAP monitor. + */ public final class SapLandscapeMonitorProvisioningState extends ExpandableStringEnum { - /** Static value Accepted for SapLandscapeMonitorProvisioningState. */ + /** + * Static value Accepted for SapLandscapeMonitorProvisioningState. + */ public static final SapLandscapeMonitorProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Created for SapLandscapeMonitorProvisioningState. */ + /** + * Static value Created for SapLandscapeMonitorProvisioningState. + */ public static final SapLandscapeMonitorProvisioningState CREATED = fromString("Created"); - /** Static value Failed for SapLandscapeMonitorProvisioningState. */ + /** + * Static value Failed for SapLandscapeMonitorProvisioningState. + */ public static final SapLandscapeMonitorProvisioningState FAILED = fromString("Failed"); - /** Static value Succeeded for SapLandscapeMonitorProvisioningState. */ + /** + * Static value Succeeded for SapLandscapeMonitorProvisioningState. + */ public static final SapLandscapeMonitorProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Canceled for SapLandscapeMonitorProvisioningState. */ + /** + * Static value Canceled for SapLandscapeMonitorProvisioningState. + */ public static final SapLandscapeMonitorProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of SapLandscapeMonitorProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public SapLandscapeMonitorProvisioningState() { /** * Creates or finds a SapLandscapeMonitorProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapLandscapeMonitorProvisioningState. */ - @JsonCreator public static SapLandscapeMonitorProvisioningState fromString(String name) { return fromString(name, SapLandscapeMonitorProvisioningState.class); } /** * Gets known SapLandscapeMonitorProvisioningState values. - * + * * @return known SapLandscapeMonitorProvisioningState values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorSidMapping.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorSidMapping.java index a8fad7b330ba..069fb7b34763 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorSidMapping.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitorSidMapping.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Gets or sets the mapping for SID to Environment/Applications. */ +/** + * Gets or sets the mapping for SID to Environment/Applications. + */ @Fluent -public final class SapLandscapeMonitorSidMapping { +public final class SapLandscapeMonitorSidMapping implements JsonSerializable { /* * Gets or sets the name of the grouping. */ - @JsonProperty(value = "name") private String name; /* * Gets or sets the list of SID's. */ - @JsonProperty(value = "topSid") private List topSid; - /** Creates an instance of SapLandscapeMonitorSidMapping class. */ + /** + * Creates an instance of SapLandscapeMonitorSidMapping class. + */ public SapLandscapeMonitorSidMapping() { } /** * Get the name property: Gets or sets the name of the grouping. - * + * * @return the name value. */ public String name() { @@ -38,7 +44,7 @@ public String name() { /** * Set the name property: Gets or sets the name of the grouping. - * + * * @param name the name value to set. * @return the SapLandscapeMonitorSidMapping object itself. */ @@ -49,7 +55,7 @@ public SapLandscapeMonitorSidMapping withName(String name) { /** * Get the topSid property: Gets or sets the list of SID's. - * + * * @return the topSid value. */ public List topSid() { @@ -58,7 +64,7 @@ public List topSid() { /** * Set the topSid property: Gets or sets the list of SID's. - * + * * @param topSid the topSid value to set. * @return the SapLandscapeMonitorSidMapping object itself. */ @@ -69,9 +75,50 @@ public SapLandscapeMonitorSidMapping withTopSid(List topSid) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("topSid", this.topSid, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapLandscapeMonitorSidMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapLandscapeMonitorSidMapping if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapLandscapeMonitorSidMapping. + */ + public static SapLandscapeMonitorSidMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapLandscapeMonitorSidMapping deserializedSapLandscapeMonitorSidMapping + = new SapLandscapeMonitorSidMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSapLandscapeMonitorSidMapping.name = reader.getString(); + } else if ("topSid".equals(fieldName)) { + List topSid = reader.readArray(reader1 -> reader1.getString()); + deserializedSapLandscapeMonitorSidMapping.topSid = topSid; + } else { + reader.skipChildren(); + } + } + + return deserializedSapLandscapeMonitorSidMapping; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitors.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitors.java index ce36bb440ba7..73a73507c7a7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitors.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapLandscapeMonitors.java @@ -8,14 +8,16 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; -/** Resource collection API of SapLandscapeMonitors. */ +/** + * Resource collection API of SapLandscapeMonitors. + */ public interface SapLandscapeMonitors { /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -23,70 +25,66 @@ public interface SapLandscapeMonitors { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String monitorName, Context context); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ SapLandscapeMonitor get(String resourceGroupName, String monitorName); /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ - Response createWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context); + Response createWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context); /** * Creates a SAP Landscape Monitor Dashboard. - * - *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * + * + * Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ - SapLandscapeMonitor create( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + SapLandscapeMonitor create(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter); /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -99,10 +97,9 @@ SapLandscapeMonitor create( /** * Deletes a SAP Landscape Monitor Dashboard. - * - *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor - * name. - * + * + * Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,50 +110,45 @@ SapLandscapeMonitor create( /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard along with {@link Response}. */ - Response updateWithResponse( - String resourceGroupName, - String monitorName, - SapLandscapeMonitorInner sapLandscapeMonitorParameter, - Context context); + Response updateWithResponse(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, Context context); /** * Patches the SAP Landscape Monitor Dashboard. - * - *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor - * name. - * + * + * Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor - * Dashboard. + * Dashboard. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration associated with SAP Landscape Monitor Dashboard. */ - SapLandscapeMonitor update( - String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + SapLandscapeMonitor update(String resourceGroupName, String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @param context The context to associate with this operation. @@ -164,24 +156,24 @@ SapLandscapeMonitor update( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name along with {@link Response}. + * group, and resource name along with {@link Response}. */ - Response listWithResponse( - String resourceGroupName, String monitorName, Context context); + Response listWithResponse(String resourceGroupName, String monitorName, + Context context); /** * Gets configuration values for Single Pane Of Glass for SAP monitor. - * - *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * + * Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource * group, and resource name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the SAP monitor resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource - * group, and resource name. + * group, and resource name. */ SapLandscapeMonitorListResult list(String resourceGroupName, String monitorName); } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapNetWeaverProviderInstanceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapNetWeaverProviderInstanceProperties.java index e5e7117c0d29..7a2ee0a23009 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapNetWeaverProviderInstanceProperties.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapNetWeaverProviderInstanceProperties.java @@ -5,89 +5,96 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Gets or sets the provider properties. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") -@JsonTypeName("SapNetWeaver") +/** + * Gets or sets the provider properties. + */ @Fluent public final class SapNetWeaverProviderInstanceProperties extends ProviderSpecificProperties { + /* + * The provider type. For example, the value can be SapHana. + */ + private String providerType = "SapNetWeaver"; + /* * Gets or sets the SAP System Identifier */ - @JsonProperty(value = "sapSid") private String sapSid; /* * Gets or sets the target virtual machine IP Address/FQDN. */ - @JsonProperty(value = "sapHostname") private String sapHostname; /* * Gets or sets the instance number of SAP NetWeaver. */ - @JsonProperty(value = "sapInstanceNr") private String sapInstanceNr; /* * Gets or sets the list of HostFile Entries */ - @JsonProperty(value = "sapHostFileEntries") private List sapHostFileEntries; /* * Gets or sets the SAP user name. */ - @JsonProperty(value = "sapUsername") private String sapUsername; /* * Sets the SAP password. */ - @JsonProperty(value = "sapPassword") private String sapPassword; /* * Gets or sets the key vault URI to secret with the SAP password. */ - @JsonProperty(value = "sapPasswordUri") private String sapPasswordUri; /* * Gets or sets the SAP Client ID. */ - @JsonProperty(value = "sapClientId") private String sapClientId; /* * Gets or sets the SAP HTTP port number. */ - @JsonProperty(value = "sapPortNumber") private String sapPortNumber; /* * Gets or sets the blob URI to SSL certificate for the SAP system. */ - @JsonProperty(value = "sslCertificateUri") private String sslCertificateUri; /* * Gets or sets certificate preference if secure communication is enabled. */ - @JsonProperty(value = "sslPreference") private SslPreference sslPreference; - /** Creates an instance of SapNetWeaverProviderInstanceProperties class. */ + /** + * Creates an instance of SapNetWeaverProviderInstanceProperties class. + */ public SapNetWeaverProviderInstanceProperties() { } + /** + * Get the providerType property: The provider type. For example, the value can be SapHana. + * + * @return the providerType value. + */ + @Override + public String providerType() { + return this.providerType; + } + /** * Get the sapSid property: Gets or sets the SAP System Identifier. - * + * * @return the sapSid value. */ public String sapSid() { @@ -96,7 +103,7 @@ public String sapSid() { /** * Set the sapSid property: Gets or sets the SAP System Identifier. - * + * * @param sapSid the sapSid value to set. * @return the SapNetWeaverProviderInstanceProperties object itself. */ @@ -107,7 +114,7 @@ public SapNetWeaverProviderInstanceProperties withSapSid(String sapSid) { /** * Get the sapHostname property: Gets or sets the target virtual machine IP Address/FQDN. - * + * * @return the sapHostname value. */ public String sapHostname() { @@ -116,7 +123,7 @@ public String sapHostname() { /** * Set the sapHostname property: Gets or sets the target virtual machine IP Address/FQDN. - * + * * @param sapHostname the sapHostname value to set. * @return the SapNetWeaverProviderInstanceProperties object itself. */ @@ -127,7 +134,7 @@ public SapNetWeaverProviderInstanceProperties withSapHostname(String sapHostname /** * Get the sapInstanceNr property: Gets or sets the instance number of SAP NetWeaver. - * + * * @return the sapInstanceNr value. */ public String sapInstanceNr() { @@ -136,7 +143,7 @@ public String sapInstanceNr() { /** * Set the sapInstanceNr property: Gets or sets the instance number of SAP NetWeaver. - * + * * @param sapInstanceNr the sapInstanceNr value to set. * @return the SapNetWeaverProviderInstanceProperties object itself. */ @@ -147,7 +154,7 @@ public SapNetWeaverProviderInstanceProperties withSapInstanceNr(String sapInstan /** * Get the sapHostFileEntries property: Gets or sets the list of HostFile Entries. - * + * * @return the sapHostFileEntries value. */ public List sapHostFileEntries() { @@ -156,7 +163,7 @@ public List sapHostFileEntries() { /** * Set the sapHostFileEntries property: Gets or sets the list of HostFile Entries. - * + * * @param sapHostFileEntries the sapHostFileEntries value to set. * @return the SapNetWeaverProviderInstanceProperties object itself. */ @@ -167,7 +174,7 @@ public SapNetWeaverProviderInstanceProperties withSapHostFileEntries(List writer.writeString(element)); + jsonWriter.writeStringField("sapUsername", this.sapUsername); + jsonWriter.writeStringField("sapPassword", this.sapPassword); + jsonWriter.writeStringField("sapPasswordUri", this.sapPasswordUri); + jsonWriter.writeStringField("sapClientId", this.sapClientId); + jsonWriter.writeStringField("sapPortNumber", this.sapPortNumber); + jsonWriter.writeStringField("sslCertificateUri", this.sslCertificateUri); + jsonWriter.writeStringField("sslPreference", this.sslPreference == null ? null : this.sslPreference.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapNetWeaverProviderInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapNetWeaverProviderInstanceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapNetWeaverProviderInstanceProperties. + */ + public static SapNetWeaverProviderInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapNetWeaverProviderInstanceProperties deserializedSapNetWeaverProviderInstanceProperties + = new SapNetWeaverProviderInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerType".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.providerType = reader.getString(); + } else if ("sapSid".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapSid = reader.getString(); + } else if ("sapHostname".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapHostname = reader.getString(); + } else if ("sapInstanceNr".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapInstanceNr = reader.getString(); + } else if ("sapHostFileEntries".equals(fieldName)) { + List sapHostFileEntries = reader.readArray(reader1 -> reader1.getString()); + deserializedSapNetWeaverProviderInstanceProperties.sapHostFileEntries = sapHostFileEntries; + } else if ("sapUsername".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapUsername = reader.getString(); + } else if ("sapPassword".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapPassword = reader.getString(); + } else if ("sapPasswordUri".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapPasswordUri = reader.getString(); + } else if ("sapClientId".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapClientId = reader.getString(); + } else if ("sapPortNumber".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sapPortNumber = reader.getString(); + } else if ("sslCertificateUri".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sslCertificateUri = reader.getString(); + } else if ("sslPreference".equals(fieldName)) { + deserializedSapNetWeaverProviderInstanceProperties.sslPreference + = SslPreference.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapNetWeaverProviderInstanceProperties; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapProductType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapProductType.java index 09f253c13295..c11756de4d13 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapProductType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapProductType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the SAP Product type. */ +/** + * Defines the SAP Product type. + */ public final class SapProductType extends ExpandableStringEnum { - /** Static value ECC for SapProductType. */ + /** + * Static value ECC for SapProductType. + */ public static final SapProductType ECC = fromString("ECC"); - /** Static value S4HANA for SapProductType. */ + /** + * Static value S4HANA for SapProductType. + */ public static final SapProductType S4HANA = fromString("S4HANA"); - /** Static value Other for SapProductType. */ + /** + * Static value Other for SapProductType. + */ public static final SapProductType OTHER = fromString("Other"); /** * Creates a new instance of SapProductType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SapProductType() { /** * Creates or finds a SapProductType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapProductType. */ - @JsonCreator public static SapProductType fromString(String name) { return fromString(name, SapProductType.class); } /** * Gets known SapProductType values. - * + * * @return known SapProductType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationRequest.java index ee5d846de3d8..9cb28ecc48aa 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationRequest.java @@ -6,72 +6,71 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SAP Sizing Recommendation request. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SAP Sizing Recommendation request. + */ @Fluent -public final class SapSizingRecommendationRequest { +public final class SapSizingRecommendationRequest implements JsonSerializable { /* * The geo-location where the resource is to be created. */ - @JsonProperty(value = "appLocation", required = true) private String appLocation; /* * Defines the environment type - Production/Non Production. */ - @JsonProperty(value = "environment", required = true) private SapEnvironmentType environment; /* * Defines the SAP Product type. */ - @JsonProperty(value = "sapProduct", required = true) private SapProductType sapProduct; /* * The deployment type. Eg: SingleServer/ThreeTier */ - @JsonProperty(value = "deploymentType", required = true) private SapDeploymentType deploymentType; /* * The SAP Application Performance Standard measurement. */ - @JsonProperty(value = "saps", required = true) private long saps; /* * The database memory configuration. */ - @JsonProperty(value = "dbMemory", required = true) private long dbMemory; /* * The database type. */ - @JsonProperty(value = "databaseType", required = true) private SapDatabaseType databaseType; /* * The DB scale method. */ - @JsonProperty(value = "dbScaleMethod") private SapDatabaseScaleMethod dbScaleMethod; /* * The high availability type. */ - @JsonProperty(value = "highAvailabilityType") private SapHighAvailabilityType highAvailabilityType; - /** Creates an instance of SapSizingRecommendationRequest class. */ + /** + * Creates an instance of SapSizingRecommendationRequest class. + */ public SapSizingRecommendationRequest() { } /** * Get the appLocation property: The geo-location where the resource is to be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -80,7 +79,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the resource is to be created. - * + * * @param appLocation the appLocation value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -91,7 +90,7 @@ public SapSizingRecommendationRequest withAppLocation(String appLocation) { /** * Get the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ public SapEnvironmentType environment() { @@ -100,7 +99,7 @@ public SapEnvironmentType environment() { /** * Set the environment property: Defines the environment type - Production/Non Production. - * + * * @param environment the environment value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -111,7 +110,7 @@ public SapSizingRecommendationRequest withEnvironment(SapEnvironmentType environ /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -120,7 +119,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -131,7 +130,7 @@ public SapSizingRecommendationRequest withSapProduct(SapProductType sapProduct) /** * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @return the deploymentType value. */ public SapDeploymentType deploymentType() { @@ -140,7 +139,7 @@ public SapDeploymentType deploymentType() { /** * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @param deploymentType the deploymentType value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -151,7 +150,7 @@ public SapSizingRecommendationRequest withDeploymentType(SapDeploymentType deplo /** * Get the saps property: The SAP Application Performance Standard measurement. - * + * * @return the saps value. */ public long saps() { @@ -160,7 +159,7 @@ public long saps() { /** * Set the saps property: The SAP Application Performance Standard measurement. - * + * * @param saps the saps value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -171,7 +170,7 @@ public SapSizingRecommendationRequest withSaps(long saps) { /** * Get the dbMemory property: The database memory configuration. - * + * * @return the dbMemory value. */ public long dbMemory() { @@ -180,7 +179,7 @@ public long dbMemory() { /** * Set the dbMemory property: The database memory configuration. - * + * * @param dbMemory the dbMemory value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -191,7 +190,7 @@ public SapSizingRecommendationRequest withDbMemory(long dbMemory) { /** * Get the databaseType property: The database type. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -200,7 +199,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. - * + * * @param databaseType the databaseType value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -211,7 +210,7 @@ public SapSizingRecommendationRequest withDatabaseType(SapDatabaseType databaseT /** * Get the dbScaleMethod property: The DB scale method. - * + * * @return the dbScaleMethod value. */ public SapDatabaseScaleMethod dbScaleMethod() { @@ -220,7 +219,7 @@ public SapDatabaseScaleMethod dbScaleMethod() { /** * Set the dbScaleMethod property: The DB scale method. - * + * * @param dbScaleMethod the dbScaleMethod value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -231,7 +230,7 @@ public SapSizingRecommendationRequest withDbScaleMethod(SapDatabaseScaleMethod d /** * Get the highAvailabilityType property: The high availability type. - * + * * @return the highAvailabilityType value. */ public SapHighAvailabilityType highAvailabilityType() { @@ -240,7 +239,7 @@ public SapHighAvailabilityType highAvailabilityType() { /** * Set the highAvailabilityType property: The high availability type. - * + * * @param highAvailabilityType the highAvailabilityType value to set. * @return the SapSizingRecommendationRequest object itself. */ @@ -251,41 +250,106 @@ public SapSizingRecommendationRequest withHighAvailabilityType(SapHighAvailabili /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (appLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appLocation in model SapSizingRecommendationRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appLocation in model SapSizingRecommendationRequest")); } if (environment() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environment in model SapSizingRecommendationRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property environment in model SapSizingRecommendationRequest")); } if (sapProduct() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapProduct in model SapSizingRecommendationRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapProduct in model SapSizingRecommendationRequest")); } if (deploymentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deploymentType in model SapSizingRecommendationRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentType in model SapSizingRecommendationRequest")); } if (databaseType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseType in model SapSizingRecommendationRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseType in model SapSizingRecommendationRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(SapSizingRecommendationRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); + jsonWriter.writeStringField("sapProduct", this.sapProduct == null ? null : this.sapProduct.toString()); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeLongField("saps", this.saps); + jsonWriter.writeLongField("dbMemory", this.dbMemory); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + jsonWriter.writeStringField("dbScaleMethod", this.dbScaleMethod == null ? null : this.dbScaleMethod.toString()); + jsonWriter.writeStringField("highAvailabilityType", + this.highAvailabilityType == null ? null : this.highAvailabilityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSizingRecommendationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSizingRecommendationRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapSizingRecommendationRequest. + */ + public static SapSizingRecommendationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSizingRecommendationRequest deserializedSapSizingRecommendationRequest + = new SapSizingRecommendationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appLocation".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.appLocation = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.environment + = SapEnvironmentType.fromString(reader.getString()); + } else if ("sapProduct".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.sapProduct + = SapProductType.fromString(reader.getString()); + } else if ("deploymentType".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("saps".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.saps = reader.getLong(); + } else if ("dbMemory".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.dbMemory = reader.getLong(); + } else if ("databaseType".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.databaseType + = SapDatabaseType.fromString(reader.getString()); + } else if ("dbScaleMethod".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.dbScaleMethod + = SapDatabaseScaleMethod.fromString(reader.getString()); + } else if ("highAvailabilityType".equals(fieldName)) { + deserializedSapSizingRecommendationRequest.highAvailabilityType + = SapHighAvailabilityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSizingRecommendationRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationResult.java index 0d54838594a2..36cb1830b1ec 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationResult.java @@ -6,11 +6,20 @@ import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; -/** An immutable client-side representation of SapSizingRecommendationResult. */ +/** + * An immutable client-side representation of SapSizingRecommendationResult. + */ public interface SapSizingRecommendationResult { + /** + * Gets the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + SapDeploymentType deploymentType(); + /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner object. - * + * * @return the inner object. */ SapSizingRecommendationResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSoftwareInstallationType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSoftwareInstallationType.java index eec1f6ba781b..95381851efc8 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSoftwareInstallationType.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSoftwareInstallationType.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The SAP software installation Type. */ +/** + * The SAP software installation Type. + */ public final class SapSoftwareInstallationType extends ExpandableStringEnum { - /** Static value ServiceInitiated for SapSoftwareInstallationType. */ + /** + * Static value ServiceInitiated for SapSoftwareInstallationType. + */ public static final SapSoftwareInstallationType SERVICE_INITIATED = fromString("ServiceInitiated"); - /** Static value SAPInstallWithoutOSConfig for SapSoftwareInstallationType. */ - public static final SapSoftwareInstallationType SAPINSTALL_WITHOUT_OSCONFIG = - fromString("SAPInstallWithoutOSConfig"); + /** + * Static value SAPInstallWithoutOSConfig for SapSoftwareInstallationType. + */ + public static final SapSoftwareInstallationType SAPINSTALL_WITHOUT_OSCONFIG + = fromString("SAPInstallWithoutOSConfig"); - /** Static value External for SapSoftwareInstallationType. */ + /** + * Static value External for SapSoftwareInstallationType. + */ public static final SapSoftwareInstallationType EXTERNAL = fromString("External"); /** * Creates a new instance of SapSoftwareInstallationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public SapSoftwareInstallationType() { /** * Creates or finds a SapSoftwareInstallationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapSoftwareInstallationType. */ - @JsonCreator public static SapSoftwareInstallationType fromString(String name) { return fromString(name, SapSoftwareInstallationType.class); } /** * Gets known SapSoftwareInstallationType values. - * + * * @return known SapSoftwareInstallationType values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedResourceSkusResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedResourceSkusResult.java index dc12a106b2c3..c7ec151ea8d4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedResourceSkusResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedResourceSkusResult.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; import java.util.List; -/** An immutable client-side representation of SapSupportedResourceSkusResult. */ +/** + * An immutable client-side representation of SapSupportedResourceSkusResult. + */ public interface SapSupportedResourceSkusResult { /** * Gets the supportedSkus property: Gets the list of SAP supported SKUs. - * + * * @return the supportedSkus value. */ List supportedSkus(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner object. - * + * * @return the inner object. */ SapSupportedResourceSkusResultInner innerModel(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSku.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSku.java index 914046f63911..3d7acd97967b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSku.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSku.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP supported SKU. */ +/** + * The SAP supported SKU. + */ @Fluent -public final class SapSupportedSku { +public final class SapSupportedSku implements JsonSerializable { /* * The VM Sku. */ - @JsonProperty(value = "vmSku") private String vmSku; /* * True if the Sku is certified for App server in the SAP system. */ - @JsonProperty(value = "isAppServerCertified") private Boolean isAppServerCertified; /* * True if the Sku is certified for Database server in the SAP system. */ - @JsonProperty(value = "isDatabaseCertified") private Boolean isDatabaseCertified; - /** Creates an instance of SapSupportedSku class. */ + /** + * Creates an instance of SapSupportedSku class. + */ public SapSupportedSku() { } /** * Get the vmSku property: The VM Sku. - * + * * @return the vmSku value. */ public String vmSku() { @@ -43,7 +48,7 @@ public String vmSku() { /** * Set the vmSku property: The VM Sku. - * + * * @param vmSku the vmSku value to set. * @return the SapSupportedSku object itself. */ @@ -54,7 +59,7 @@ public SapSupportedSku withVmSku(String vmSku) { /** * Get the isAppServerCertified property: True if the Sku is certified for App server in the SAP system. - * + * * @return the isAppServerCertified value. */ public Boolean isAppServerCertified() { @@ -63,7 +68,7 @@ public Boolean isAppServerCertified() { /** * Set the isAppServerCertified property: True if the Sku is certified for App server in the SAP system. - * + * * @param isAppServerCertified the isAppServerCertified value to set. * @return the SapSupportedSku object itself. */ @@ -74,7 +79,7 @@ public SapSupportedSku withIsAppServerCertified(Boolean isAppServerCertified) { /** * Get the isDatabaseCertified property: True if the Sku is certified for Database server in the SAP system. - * + * * @return the isDatabaseCertified value. */ public Boolean isDatabaseCertified() { @@ -83,7 +88,7 @@ public Boolean isDatabaseCertified() { /** * Set the isDatabaseCertified property: True if the Sku is certified for Database server in the SAP system. - * + * * @param isDatabaseCertified the isDatabaseCertified value to set. * @return the SapSupportedSku object itself. */ @@ -94,9 +99,51 @@ public SapSupportedSku withIsDatabaseCertified(Boolean isDatabaseCertified) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSku", this.vmSku); + jsonWriter.writeBooleanField("isAppServerCertified", this.isAppServerCertified); + jsonWriter.writeBooleanField("isDatabaseCertified", this.isDatabaseCertified); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSupportedSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSupportedSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SapSupportedSku. + */ + public static SapSupportedSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSupportedSku deserializedSapSupportedSku = new SapSupportedSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSku".equals(fieldName)) { + deserializedSapSupportedSku.vmSku = reader.getString(); + } else if ("isAppServerCertified".equals(fieldName)) { + deserializedSapSupportedSku.isAppServerCertified = reader.getNullable(JsonReader::getBoolean); + } else if ("isDatabaseCertified".equals(fieldName)) { + deserializedSapSupportedSku.isDatabaseCertified = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSupportedSku; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSkusRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSkusRequest.java index e98fd4bbb076..86cc2b8ef183 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSkusRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSkusRequest.java @@ -6,54 +6,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP request to get list of supported SKUs. */ +/** + * The SAP request to get list of supported SKUs. + */ @Fluent -public final class SapSupportedSkusRequest { +public final class SapSupportedSkusRequest implements JsonSerializable { /* * The geo-location where the resource is to be created. */ - @JsonProperty(value = "appLocation", required = true) private String appLocation; /* * Defines the environment type - Production/Non Production. */ - @JsonProperty(value = "environment", required = true) private SapEnvironmentType environment; /* * Defines the SAP Product type. */ - @JsonProperty(value = "sapProduct", required = true) private SapProductType sapProduct; /* * The deployment type. Eg: SingleServer/ThreeTier */ - @JsonProperty(value = "deploymentType", required = true) private SapDeploymentType deploymentType; /* * The database type. Eg: HANA, DB2, etc */ - @JsonProperty(value = "databaseType", required = true) private SapDatabaseType databaseType; /* * The high availability type. */ - @JsonProperty(value = "highAvailabilityType") private SapHighAvailabilityType highAvailabilityType; - /** Creates an instance of SapSupportedSkusRequest class. */ + /** + * Creates an instance of SapSupportedSkusRequest class. + */ public SapSupportedSkusRequest() { } /** * Get the appLocation property: The geo-location where the resource is to be created. - * + * * @return the appLocation value. */ public String appLocation() { @@ -62,7 +64,7 @@ public String appLocation() { /** * Set the appLocation property: The geo-location where the resource is to be created. - * + * * @param appLocation the appLocation value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -73,7 +75,7 @@ public SapSupportedSkusRequest withAppLocation(String appLocation) { /** * Get the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ public SapEnvironmentType environment() { @@ -82,7 +84,7 @@ public SapEnvironmentType environment() { /** * Set the environment property: Defines the environment type - Production/Non Production. - * + * * @param environment the environment value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -93,7 +95,7 @@ public SapSupportedSkusRequest withEnvironment(SapEnvironmentType environment) { /** * Get the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ public SapProductType sapProduct() { @@ -102,7 +104,7 @@ public SapProductType sapProduct() { /** * Set the sapProduct property: Defines the SAP Product type. - * + * * @param sapProduct the sapProduct value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -113,7 +115,7 @@ public SapSupportedSkusRequest withSapProduct(SapProductType sapProduct) { /** * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @return the deploymentType value. */ public SapDeploymentType deploymentType() { @@ -122,7 +124,7 @@ public SapDeploymentType deploymentType() { /** * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. - * + * * @param deploymentType the deploymentType value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -133,7 +135,7 @@ public SapSupportedSkusRequest withDeploymentType(SapDeploymentType deploymentTy /** * Get the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -142,7 +144,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. Eg: HANA, DB2, etc. - * + * * @param databaseType the databaseType value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -153,7 +155,7 @@ public SapSupportedSkusRequest withDatabaseType(SapDatabaseType databaseType) { /** * Get the highAvailabilityType property: The high availability type. - * + * * @return the highAvailabilityType value. */ public SapHighAvailabilityType highAvailabilityType() { @@ -162,7 +164,7 @@ public SapHighAvailabilityType highAvailabilityType() { /** * Set the highAvailabilityType property: The high availability type. - * + * * @param highAvailabilityType the highAvailabilityType value to set. * @return the SapSupportedSkusRequest object itself. */ @@ -173,41 +175,92 @@ public SapSupportedSkusRequest withHighAvailabilityType(SapHighAvailabilityType /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (appLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property appLocation in model SapSupportedSkusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appLocation in model SapSupportedSkusRequest")); } if (environment() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property environment in model SapSupportedSkusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property environment in model SapSupportedSkusRequest")); } if (sapProduct() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapProduct in model SapSupportedSkusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapProduct in model SapSupportedSkusRequest")); } if (deploymentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deploymentType in model SapSupportedSkusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentType in model SapSupportedSkusRequest")); } if (databaseType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseType in model SapSupportedSkusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseType in model SapSupportedSkusRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(SapSupportedSkusRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appLocation", this.appLocation); + jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); + jsonWriter.writeStringField("sapProduct", this.sapProduct == null ? null : this.sapProduct.toString()); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + jsonWriter.writeStringField("highAvailabilityType", + this.highAvailabilityType == null ? null : this.highAvailabilityType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSupportedSkusRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSupportedSkusRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapSupportedSkusRequest. + */ + public static SapSupportedSkusRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSupportedSkusRequest deserializedSapSupportedSkusRequest = new SapSupportedSkusRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appLocation".equals(fieldName)) { + deserializedSapSupportedSkusRequest.appLocation = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedSapSupportedSkusRequest.environment = SapEnvironmentType.fromString(reader.getString()); + } else if ("sapProduct".equals(fieldName)) { + deserializedSapSupportedSkusRequest.sapProduct = SapProductType.fromString(reader.getString()); + } else if ("deploymentType".equals(fieldName)) { + deserializedSapSupportedSkusRequest.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("databaseType".equals(fieldName)) { + deserializedSapSupportedSkusRequest.databaseType = SapDatabaseType.fromString(reader.getString()); + } else if ("highAvailabilityType".equals(fieldName)) { + deserializedSapSupportedSkusRequest.highAvailabilityType + = SapHighAvailabilityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSupportedSkusRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstance.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstance.java index c0c0540eeae4..025e10a94425 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstance.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstance.java @@ -10,39 +10,41 @@ import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; import java.util.Map; -/** An immutable client-side representation of SapVirtualInstance. */ +/** + * An immutable client-side representation of SapVirtualInstance. + */ public interface SapVirtualInstance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -50,28 +52,28 @@ public interface SapVirtualInstance { /** * Gets the identity property: A pre-created user assigned identity with appropriate roles assigned. To learn more * on identity and roles required, visit the ACSS how-to-guide. - * + * * @return the identity value. */ UserAssignedServiceIdentity identity(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the environment property: Defines the environment type - Production/Non Production. - * + * * @return the environment value. */ SapEnvironmentType environment(); /** * Gets the sapProduct property: Defines the SAP Product type. - * + * * @return the sapProduct value. */ SapProductType sapProduct(); @@ -79,101 +81,106 @@ public interface SapVirtualInstance { /** * Gets the configuration property: Defines if the SAP system is being created using Azure Center for SAP solutions * (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @return the configuration value. */ SapConfiguration configuration(); /** * Gets the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @return the managedResourceGroupConfiguration value. */ ManagedRGConfiguration managedResourceGroupConfiguration(); /** * Gets the status property: Defines the SAP Instance status. - * + * * @return the status value. */ SapVirtualInstanceStatus status(); /** * Gets the health property: Defines the health of SAP Instances. - * + * * @return the health value. */ SapHealthState health(); /** * Gets the state property: Defines the Virtual Instance for SAP state. - * + * * @return the state value. */ SapVirtualInstanceState state(); /** * Gets the provisioningState property: Defines the provisioning states. - * + * * @return the provisioningState value. */ SapVirtualInstanceProvisioningState provisioningState(); /** * Gets the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. - * + * * @return the errors value. */ SapVirtualInstanceError errors(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner object. - * + * * @return the inner object. */ SapVirtualInstanceInner innerModel(); - /** The entirety of the SapVirtualInstance definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithEnvironment, - DefinitionStages.WithSapProduct, - DefinitionStages.WithConfiguration, - DefinitionStages.WithCreate { + /** + * The entirety of the SapVirtualInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithEnvironment, DefinitionStages.WithSapProduct, + DefinitionStages.WithConfiguration, DefinitionStages.WithCreate { } - /** The SapVirtualInstance definition stages. */ + + /** + * The SapVirtualInstance definition stages. + */ interface DefinitionStages { - /** The first stage of the SapVirtualInstance definition. */ + /** + * The first stage of the SapVirtualInstance definition. + */ interface Blank extends WithLocation { } - /** The stage of the SapVirtualInstance definition allowing to specify location. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -181,169 +188,201 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the SapVirtualInstance definition allowing to specify parent resource. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithEnvironment withExistingResourceGroup(String resourceGroupName); } - /** The stage of the SapVirtualInstance definition allowing to specify environment. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify environment. + */ interface WithEnvironment { /** * Specifies the environment property: Defines the environment type - Production/Non Production.. - * + * * @param environment Defines the environment type - Production/Non Production. * @return the next definition stage. */ WithSapProduct withEnvironment(SapEnvironmentType environment); } - /** The stage of the SapVirtualInstance definition allowing to specify sapProduct. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify sapProduct. + */ interface WithSapProduct { /** * Specifies the sapProduct property: Defines the SAP Product type.. - * + * * @param sapProduct Defines the SAP Product type. * @return the next definition stage. */ WithConfiguration withSapProduct(SapProductType sapProduct); } - /** The stage of the SapVirtualInstance definition allowing to specify configuration. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify configuration. + */ interface WithConfiguration { /** * Specifies the configuration property: Defines if the SAP system is being created using Azure Center for * SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS. - * + * * @param configuration Defines if the SAP system is being created using Azure Center for SAP solutions - * (ACSS) or if an existing SAP system is being registered with ACSS. + * (ACSS) or if an existing SAP system is being registered with ACSS. * @return the next definition stage. */ WithCreate withConfiguration(SapConfiguration configuration); } + /** * The stage of the SapVirtualInstance 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.WithIdentity, - DefinitionStages.WithManagedResourceGroupConfiguration { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithManagedResourceGroupConfiguration { /** * Executes the create request. - * + * * @return the created resource. */ SapVirtualInstance create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ SapVirtualInstance create(Context context); } - /** The stage of the SapVirtualInstance definition allowing to specify tags. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the SapVirtualInstance definition allowing to specify identity. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: A pre-created user assigned identity with appropriate roles assigned. To * learn more on identity and roles required, visit the ACSS how-to-guide.. - * + * * @param identity A pre-created user assigned identity with appropriate roles assigned. To learn more on - * identity and roles required, visit the ACSS how-to-guide. + * identity and roles required, visit the ACSS how-to-guide. * @return the next definition stage. */ WithCreate withIdentity(UserAssignedServiceIdentity identity); } - /** The stage of the SapVirtualInstance definition allowing to specify managedResourceGroupConfiguration. */ + + /** + * The stage of the SapVirtualInstance definition allowing to specify managedResourceGroupConfiguration. + */ interface WithManagedResourceGroupConfiguration { /** * Specifies the managedResourceGroupConfiguration property: Managed resource group configuration. - * + * * @param managedResourceGroupConfiguration Managed resource group configuration. * @return the next definition stage. */ WithCreate withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration); } } + /** * Begins update for the SapVirtualInstance resource. - * + * * @return the stage of resource update. */ SapVirtualInstance.Update update(); - /** The template for SapVirtualInstance update. */ + /** + * The template for SapVirtualInstance update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. - * + * * @return the updated resource. */ SapVirtualInstance apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ SapVirtualInstance apply(Context context); } - /** The SapVirtualInstance update stages. */ + + /** + * The SapVirtualInstance update stages. + */ interface UpdateStages { - /** The stage of the SapVirtualInstance update allowing to specify tags. */ + /** + * The stage of the SapVirtualInstance update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Gets or sets the Resource tags.. - * + * * @param tags Gets or sets the Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the SapVirtualInstance update allowing to specify identity. */ + + /** + * The stage of the SapVirtualInstance update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: A pre-created user assigned identity with appropriate roles assigned. To * learn more on identity and roles required, visit the ACSS how-to-guide.. - * + * * @param identity A pre-created user assigned identity with appropriate roles assigned. To learn more on - * identity and roles required, visit the ACSS how-to-guide. + * identity and roles required, visit the ACSS how-to-guide. * @return the next definition stage. */ Update withIdentity(UserAssignedServiceIdentity identity); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ SapVirtualInstance refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -351,7 +390,7 @@ interface WithIdentity { /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -360,7 +399,7 @@ interface WithIdentity { /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -371,7 +410,7 @@ interface WithIdentity { /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. @@ -380,7 +419,7 @@ interface WithIdentity { /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param body The Virtual Instance for SAP solutions resource stop request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceError.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceError.java index 5f503e6d70ea..e4cdcd39b4f7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceError.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceError.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** An error response from the Virtual Instance for SAP Workload service. */ +/** + * An error response from the Virtual Instance for SAP Workload service. + */ @Fluent -public final class SapVirtualInstanceError { +public final class SapVirtualInstanceError implements JsonSerializable { /* * The Virtual Instance for SAP error body. */ - @JsonProperty(value = "properties") private ErrorDefinition properties; - /** Creates an instance of SapVirtualInstanceError class. */ + /** + * Creates an instance of SapVirtualInstanceError class. + */ public SapVirtualInstanceError() { } /** * Get the properties property: The Virtual Instance for SAP error body. - * + * * @return the properties value. */ public ErrorDefinition properties() { @@ -31,7 +38,7 @@ public ErrorDefinition properties() { /** * Set the properties property: The Virtual Instance for SAP error body. - * + * * @param properties the properties value to set. * @return the SapVirtualInstanceError object itself. */ @@ -42,7 +49,7 @@ public SapVirtualInstanceError withProperties(ErrorDefinition properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapVirtualInstanceError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapVirtualInstanceError if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapVirtualInstanceError. + */ + public static SapVirtualInstanceError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapVirtualInstanceError deserializedSapVirtualInstanceError = new SapVirtualInstanceError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSapVirtualInstanceError.properties = ErrorDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapVirtualInstanceError; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceList.java index bb0a69d59d4d..4365c560c591 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceList.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Defines the collection of Virtual Instance for SAP solutions resources. */ +/** + * Defines the collection of Virtual Instance for SAP solutions resources. + */ @Fluent -public final class SapVirtualInstanceList { +public final class SapVirtualInstanceList implements JsonSerializable { /* * Gets the list of Virtual Instances for SAP solutions resources. */ - @JsonProperty(value = "value") private List value; /* * Gets the value of next link. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of SapVirtualInstanceList class. */ + /** + * Creates an instance of SapVirtualInstanceList class. + */ public SapVirtualInstanceList() { } /** * Get the value property: Gets the list of Virtual Instances for SAP solutions resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: Gets the list of Virtual Instances for SAP solutions resources. - * + * * @param value the value value to set. * @return the SapVirtualInstanceList object itself. */ @@ -50,7 +56,7 @@ public SapVirtualInstanceList withValue(List value) { /** * Get the nextLink property: Gets the value of next link. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: Gets the value of next link. - * + * * @param nextLink the nextLink value to set. * @return the SapVirtualInstanceList object itself. */ @@ -70,7 +76,7 @@ public SapVirtualInstanceList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapVirtualInstanceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapVirtualInstanceList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapVirtualInstanceList. + */ + public static SapVirtualInstanceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapVirtualInstanceList deserializedSapVirtualInstanceList = new SapVirtualInstanceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SapVirtualInstanceInner.fromJson(reader1)); + deserializedSapVirtualInstanceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSapVirtualInstanceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSapVirtualInstanceList; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceProvisioningState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceProvisioningState.java index a55a30d084d2..1900b83d8179 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceProvisioningState.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceProvisioningState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the provisioning states. */ +/** + * Defines the provisioning states. + */ public final class SapVirtualInstanceProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for SapVirtualInstanceProvisioningState. */ + /** + * Static value Succeeded for SapVirtualInstanceProvisioningState. + */ public static final SapVirtualInstanceProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Updating for SapVirtualInstanceProvisioningState. */ + /** + * Static value Updating for SapVirtualInstanceProvisioningState. + */ public static final SapVirtualInstanceProvisioningState UPDATING = fromString("Updating"); - /** Static value Creating for SapVirtualInstanceProvisioningState. */ + /** + * Static value Creating for SapVirtualInstanceProvisioningState. + */ public static final SapVirtualInstanceProvisioningState CREATING = fromString("Creating"); - /** Static value Failed for SapVirtualInstanceProvisioningState. */ + /** + * Static value Failed for SapVirtualInstanceProvisioningState. + */ public static final SapVirtualInstanceProvisioningState FAILED = fromString("Failed"); - /** Static value Deleting for SapVirtualInstanceProvisioningState. */ + /** + * Static value Deleting for SapVirtualInstanceProvisioningState. + */ public static final SapVirtualInstanceProvisioningState DELETING = fromString("Deleting"); /** * Creates a new instance of SapVirtualInstanceProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public SapVirtualInstanceProvisioningState() { /** * Creates or finds a SapVirtualInstanceProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapVirtualInstanceProvisioningState. */ - @JsonCreator public static SapVirtualInstanceProvisioningState fromString(String name) { return fromString(name, SapVirtualInstanceProvisioningState.class); } /** * Gets known SapVirtualInstanceProvisioningState values. - * + * * @return known SapVirtualInstanceProvisioningState values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceState.java index 2477bc03b0cb..e7995045821c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceState.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceState.java @@ -5,56 +5,81 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the Virtual Instance for SAP state. */ +/** + * Defines the Virtual Instance for SAP state. + */ public final class SapVirtualInstanceState extends ExpandableStringEnum { - /** Static value InfrastructureDeploymentPending for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_PENDING = - fromString("InfrastructureDeploymentPending"); + /** + * Static value InfrastructureDeploymentPending for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_PENDING + = fromString("InfrastructureDeploymentPending"); - /** Static value InfrastructureDeploymentInProgress for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_IN_PROGRESS = - fromString("InfrastructureDeploymentInProgress"); + /** + * Static value InfrastructureDeploymentInProgress for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_IN_PROGRESS + = fromString("InfrastructureDeploymentInProgress"); - /** Static value InfrastructureDeploymentFailed for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_FAILED = - fromString("InfrastructureDeploymentFailed"); + /** + * Static value InfrastructureDeploymentFailed for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_FAILED + = fromString("InfrastructureDeploymentFailed"); - /** Static value SoftwareInstallationPending for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_PENDING = - fromString("SoftwareInstallationPending"); + /** + * Static value SoftwareInstallationPending for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_PENDING + = fromString("SoftwareInstallationPending"); - /** Static value SoftwareInstallationInProgress for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_IN_PROGRESS = - fromString("SoftwareInstallationInProgress"); + /** + * Static value SoftwareInstallationInProgress for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_IN_PROGRESS + = fromString("SoftwareInstallationInProgress"); - /** Static value SoftwareInstallationFailed for SapVirtualInstanceState. */ + /** + * Static value SoftwareInstallationFailed for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_FAILED = fromString("SoftwareInstallationFailed"); - /** Static value SoftwareDetectionInProgress for SapVirtualInstanceState. */ - public static final SapVirtualInstanceState SOFTWARE_DETECTION_IN_PROGRESS = - fromString("SoftwareDetectionInProgress"); + /** + * Static value SoftwareDetectionInProgress for SapVirtualInstanceState. + */ + public static final SapVirtualInstanceState SOFTWARE_DETECTION_IN_PROGRESS + = fromString("SoftwareDetectionInProgress"); - /** Static value SoftwareDetectionFailed for SapVirtualInstanceState. */ + /** + * Static value SoftwareDetectionFailed for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState SOFTWARE_DETECTION_FAILED = fromString("SoftwareDetectionFailed"); - /** Static value DiscoveryPending for SapVirtualInstanceState. */ + /** + * Static value DiscoveryPending for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState DISCOVERY_PENDING = fromString("DiscoveryPending"); - /** Static value DiscoveryInProgress for SapVirtualInstanceState. */ + /** + * Static value DiscoveryInProgress for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState DISCOVERY_IN_PROGRESS = fromString("DiscoveryInProgress"); - /** Static value DiscoveryFailed for SapVirtualInstanceState. */ + /** + * Static value DiscoveryFailed for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState DISCOVERY_FAILED = fromString("DiscoveryFailed"); - /** Static value RegistrationComplete for SapVirtualInstanceState. */ + /** + * Static value RegistrationComplete for SapVirtualInstanceState. + */ public static final SapVirtualInstanceState REGISTRATION_COMPLETE = fromString("RegistrationComplete"); /** * Creates a new instance of SapVirtualInstanceState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -63,18 +88,17 @@ public SapVirtualInstanceState() { /** * Creates or finds a SapVirtualInstanceState from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapVirtualInstanceState. */ - @JsonCreator public static SapVirtualInstanceState fromString(String name) { return fromString(name, SapVirtualInstanceState.class); } /** * Gets known SapVirtualInstanceState values. - * + * * @return known SapVirtualInstanceState values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceStatus.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceStatus.java index bf1d0765ae02..5f94d859157d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceStatus.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceStatus.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the SAP Instance status. */ +/** + * Defines the SAP Instance status. + */ public final class SapVirtualInstanceStatus extends ExpandableStringEnum { - /** Static value Starting for SapVirtualInstanceStatus. */ + /** + * Static value Starting for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus STARTING = fromString("Starting"); - /** Static value Running for SapVirtualInstanceStatus. */ + /** + * Static value Running for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus RUNNING = fromString("Running"); - /** Static value Stopping for SapVirtualInstanceStatus. */ + /** + * Static value Stopping for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus STOPPING = fromString("Stopping"); - /** Static value Offline for SapVirtualInstanceStatus. */ + /** + * Static value Offline for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus OFFLINE = fromString("Offline"); - /** Static value PartiallyRunning for SapVirtualInstanceStatus. */ + /** + * Static value PartiallyRunning for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus PARTIALLY_RUNNING = fromString("PartiallyRunning"); - /** Static value Unavailable for SapVirtualInstanceStatus. */ + /** + * Static value Unavailable for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus UNAVAILABLE = fromString("Unavailable"); - /** Static value SoftShutdown for SapVirtualInstanceStatus. */ + /** + * Static value SoftShutdown for SapVirtualInstanceStatus. + */ public static final SapVirtualInstanceStatus SOFT_SHUTDOWN = fromString("SoftShutdown"); /** * Creates a new instance of SapVirtualInstanceStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public SapVirtualInstanceStatus() { /** * Creates or finds a SapVirtualInstanceStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding SapVirtualInstanceStatus. */ - @JsonCreator public static SapVirtualInstanceStatus fromString(String name) { return fromString(name, SapVirtualInstanceStatus.class); } /** * Gets known SapVirtualInstanceStatus values. - * + * * @return known SapVirtualInstanceStatus values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstances.java index 9e807f2777d4..47c76ca1df27 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstances.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstances.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SapVirtualInstances. */ +/** + * Resource collection API of SapVirtualInstances. + */ public interface SapVirtualInstances { /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -21,12 +23,12 @@ public interface SapVirtualInstances { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Virtual Instance for SAP solutions resource along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String sapVirtualInstanceName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String sapVirtualInstanceName, + Context context); /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -39,7 +41,7 @@ Response getByResourceGroupWithResponse( /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +54,7 @@ Response getByResourceGroupWithResponse( /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -65,54 +67,54 @@ Response getByResourceGroupWithResponse( /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with + * {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Gets all Virtual Instances for SAP solutions resources in a Subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link - * PagedIterable}. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +126,7 @@ Response getByResourceGroupWithResponse( /** * Starts the SAP application, that is the Central Services instance and Application server instances. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param context The context to associate with this operation. @@ -137,7 +139,7 @@ Response getByResourceGroupWithResponse( /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -149,7 +151,7 @@ Response getByResourceGroupWithResponse( /** * Stops the SAP Application, that is the Application server instances and Central Services instance. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. * @param body The Virtual Instance for SAP solutions resource stop request body. @@ -159,12 +161,12 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the current status of an async operation. */ - OperationStatusResult stop( - String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body, + Context context); /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -175,7 +177,7 @@ OperationStatusResult stop( /** * Gets a Virtual Instance for SAP solutions resource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -188,7 +190,7 @@ OperationStatusResult stop( /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -200,7 +202,7 @@ OperationStatusResult stop( /** * Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central * Services Instance, Application Server Instances and Database Instance. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +214,7 @@ OperationStatusResult stop( /** * Begins definition for a new SapVirtualInstance resource. - * + * * @param name resource name. * @return the first stage of the new SapVirtualInstance definition. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ServiceInitiatedSoftwareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ServiceInitiatedSoftwareConfiguration.java index 9b27aa684482..ce44c0b0e5ec 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ServiceInitiatedSoftwareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ServiceInitiatedSoftwareConfiguration.java @@ -6,58 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The SAP Software configuration Input when the software is to be installed by service. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") -@JsonTypeName("ServiceInitiated") +/** + * The SAP Software configuration Input when the software is to be installed by service. + */ @Fluent public final class ServiceInitiatedSoftwareConfiguration extends SoftwareConfiguration { + /* + * The SAP software installation Type. + */ + private SapSoftwareInstallationType softwareInstallationType = SapSoftwareInstallationType.SERVICE_INITIATED; + /* * The URL to the SAP Build of Materials(BOM) file. */ - @JsonProperty(value = "bomUrl", required = true) private String bomUrl; /* * The software version to install. */ - @JsonProperty(value = "softwareVersion", required = true) private String softwareVersion; /* * The SAP bits storage account id. */ - @JsonProperty(value = "sapBitsStorageAccountId", required = true) private String sapBitsStorageAccountId; /* * The FQDN to set for the SAP system during install. */ - @JsonProperty(value = "sapFqdn", required = true) private String sapFqdn; /* * The SSH private key. */ - @JsonProperty(value = "sshPrivateKey", required = true) private String sshPrivateKey; /* * Gets or sets the HA software configuration. */ - @JsonProperty(value = "highAvailabilitySoftwareConfiguration") private HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration; - /** Creates an instance of ServiceInitiatedSoftwareConfiguration class. */ + /** + * Creates an instance of ServiceInitiatedSoftwareConfiguration class. + */ public ServiceInitiatedSoftwareConfiguration() { } + /** + * Get the softwareInstallationType property: The SAP software installation Type. + * + * @return the softwareInstallationType value. + */ + @Override + public SapSoftwareInstallationType softwareInstallationType() { + return this.softwareInstallationType; + } + /** * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. - * + * * @return the bomUrl value. */ public String bomUrl() { @@ -66,7 +78,7 @@ public String bomUrl() { /** * Set the bomUrl property: The URL to the SAP Build of Materials(BOM) file. - * + * * @param bomUrl the bomUrl value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -77,7 +89,7 @@ public ServiceInitiatedSoftwareConfiguration withBomUrl(String bomUrl) { /** * Get the softwareVersion property: The software version to install. - * + * * @return the softwareVersion value. */ public String softwareVersion() { @@ -86,7 +98,7 @@ public String softwareVersion() { /** * Set the softwareVersion property: The software version to install. - * + * * @param softwareVersion the softwareVersion value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -97,7 +109,7 @@ public ServiceInitiatedSoftwareConfiguration withSoftwareVersion(String software /** * Get the sapBitsStorageAccountId property: The SAP bits storage account id. - * + * * @return the sapBitsStorageAccountId value. */ public String sapBitsStorageAccountId() { @@ -106,7 +118,7 @@ public String sapBitsStorageAccountId() { /** * Set the sapBitsStorageAccountId property: The SAP bits storage account id. - * + * * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -117,7 +129,7 @@ public ServiceInitiatedSoftwareConfiguration withSapBitsStorageAccountId(String /** * Get the sapFqdn property: The FQDN to set for the SAP system during install. - * + * * @return the sapFqdn value. */ public String sapFqdn() { @@ -126,7 +138,7 @@ public String sapFqdn() { /** * Set the sapFqdn property: The FQDN to set for the SAP system during install. - * + * * @param sapFqdn the sapFqdn value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -137,7 +149,7 @@ public ServiceInitiatedSoftwareConfiguration withSapFqdn(String sapFqdn) { /** * Get the sshPrivateKey property: The SSH private key. - * + * * @return the sshPrivateKey value. */ public String sshPrivateKey() { @@ -146,7 +158,7 @@ public String sshPrivateKey() { /** * Set the sshPrivateKey property: The SSH private key. - * + * * @param sshPrivateKey the sshPrivateKey value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -157,7 +169,7 @@ public ServiceInitiatedSoftwareConfiguration withSshPrivateKey(String sshPrivate /** * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. - * + * * @return the highAvailabilitySoftwareConfiguration value. */ public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { @@ -166,7 +178,7 @@ public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfigurati /** * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. - * + * * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. * @return the ServiceInitiatedSoftwareConfiguration object itself. */ @@ -178,42 +190,36 @@ public ServiceInitiatedSoftwareConfiguration withHighAvailabilitySoftwareConfigu /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (bomUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property bomUrl in model ServiceInitiatedSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property bomUrl in model ServiceInitiatedSoftwareConfiguration")); } if (softwareVersion() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property softwareVersion in model ServiceInitiatedSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property softwareVersion in model ServiceInitiatedSoftwareConfiguration")); } if (sapBitsStorageAccountId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapBitsStorageAccountId in model" - + " ServiceInitiatedSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model ServiceInitiatedSoftwareConfiguration")); } if (sapFqdn() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sapFqdn in model ServiceInitiatedSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sapFqdn in model ServiceInitiatedSoftwareConfiguration")); } if (sshPrivateKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sshPrivateKey in model ServiceInitiatedSoftwareConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sshPrivateKey in model ServiceInitiatedSoftwareConfiguration")); } if (highAvailabilitySoftwareConfiguration() != null) { highAvailabilitySoftwareConfiguration().validate(); @@ -221,4 +227,63 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ServiceInitiatedSoftwareConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bomUrl", this.bomUrl); + jsonWriter.writeStringField("softwareVersion", this.softwareVersion); + jsonWriter.writeStringField("sapBitsStorageAccountId", this.sapBitsStorageAccountId); + jsonWriter.writeStringField("sapFqdn", this.sapFqdn); + jsonWriter.writeStringField("sshPrivateKey", this.sshPrivateKey); + jsonWriter.writeStringField("softwareInstallationType", + this.softwareInstallationType == null ? null : this.softwareInstallationType.toString()); + jsonWriter.writeJsonField("highAvailabilitySoftwareConfiguration", this.highAvailabilitySoftwareConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceInitiatedSoftwareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceInitiatedSoftwareConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceInitiatedSoftwareConfiguration. + */ + public static ServiceInitiatedSoftwareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceInitiatedSoftwareConfiguration deserializedServiceInitiatedSoftwareConfiguration + = new ServiceInitiatedSoftwareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bomUrl".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.bomUrl = reader.getString(); + } else if ("softwareVersion".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.softwareVersion = reader.getString(); + } else if ("sapBitsStorageAccountId".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.sapBitsStorageAccountId = reader.getString(); + } else if ("sapFqdn".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.sapFqdn = reader.getString(); + } else if ("sshPrivateKey".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.sshPrivateKey = reader.getString(); + } else if ("softwareInstallationType".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.softwareInstallationType + = SapSoftwareInstallationType.fromString(reader.getString()); + } else if ("highAvailabilitySoftwareConfiguration".equals(fieldName)) { + deserializedServiceInitiatedSoftwareConfiguration.highAvailabilitySoftwareConfiguration + = HighAvailabilitySoftwareConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceInitiatedSoftwareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SharedStorageResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SharedStorageResourceNames.java index fb240937ff52..8828a01cd764 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SharedStorageResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SharedStorageResourceNames.java @@ -5,33 +5,39 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The resource names object for shared storage. */ +/** + * The resource names object for shared storage. + */ @Fluent -public final class SharedStorageResourceNames { +public final class SharedStorageResourceNames implements JsonSerializable { /* * The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 * chars}. */ - @JsonProperty(value = "sharedStorageAccountName") private String sharedStorageAccountName; /* - * The full name of private end point for the shared storage account. If it is not provided, it will be defaulted - * to {storageAccountName}_pe + * The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to + * {storageAccountName}_pe */ - @JsonProperty(value = "sharedStorageAccountPrivateEndPointName") private String sharedStorageAccountPrivateEndPointName; - /** Creates an instance of SharedStorageResourceNames class. */ + /** + * Creates an instance of SharedStorageResourceNames class. + */ public SharedStorageResourceNames() { } /** * Get the sharedStorageAccountName property: The full name of the shared storage account. If it is not provided, it * will be defaulted to {SID}nfs{guid of 15 chars}. - * + * * @return the sharedStorageAccountName value. */ public String sharedStorageAccountName() { @@ -41,7 +47,7 @@ public String sharedStorageAccountName() { /** * Set the sharedStorageAccountName property: The full name of the shared storage account. If it is not provided, it * will be defaulted to {SID}nfs{guid of 15 chars}. - * + * * @param sharedStorageAccountName the sharedStorageAccountName value to set. * @return the SharedStorageResourceNames object itself. */ @@ -53,7 +59,7 @@ public SharedStorageResourceNames withSharedStorageAccountName(String sharedStor /** * Get the sharedStorageAccountPrivateEndPointName property: The full name of private end point for the shared * storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. - * + * * @return the sharedStorageAccountPrivateEndPointName value. */ public String sharedStorageAccountPrivateEndPointName() { @@ -63,21 +69,61 @@ public String sharedStorageAccountPrivateEndPointName() { /** * Set the sharedStorageAccountPrivateEndPointName property: The full name of private end point for the shared * storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. - * + * * @param sharedStorageAccountPrivateEndPointName the sharedStorageAccountPrivateEndPointName value to set. * @return the SharedStorageResourceNames object itself. */ - public SharedStorageResourceNames withSharedStorageAccountPrivateEndPointName( - String sharedStorageAccountPrivateEndPointName) { + public SharedStorageResourceNames + withSharedStorageAccountPrivateEndPointName(String sharedStorageAccountPrivateEndPointName) { this.sharedStorageAccountPrivateEndPointName = sharedStorageAccountPrivateEndPointName; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sharedStorageAccountName", this.sharedStorageAccountName); + jsonWriter.writeStringField("sharedStorageAccountPrivateEndPointName", + this.sharedStorageAccountPrivateEndPointName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharedStorageResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharedStorageResourceNames if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SharedStorageResourceNames. + */ + public static SharedStorageResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SharedStorageResourceNames deserializedSharedStorageResourceNames = new SharedStorageResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sharedStorageAccountName".equals(fieldName)) { + deserializedSharedStorageResourceNames.sharedStorageAccountName = reader.getString(); + } else if ("sharedStorageAccountPrivateEndPointName".equals(fieldName)) { + deserializedSharedStorageResourceNames.sharedStorageAccountPrivateEndPointName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSharedStorageResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerConfiguration.java index 59011c775bd6..afea195dad33 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerConfiguration.java @@ -6,61 +6,71 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets the single server configuration. For prerequisites for creating the infrastructure, please see * [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") -@JsonTypeName("SingleServer") @Fluent public final class SingleServerConfiguration extends InfrastructureConfiguration { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.SINGLE_SERVER; + /* * Network configuration for the server */ - @JsonProperty(value = "networkConfiguration") private NetworkConfiguration networkConfiguration; /* * The database type. */ - @JsonProperty(value = "databaseType") private SapDatabaseType databaseType; /* * The subnet id. */ - @JsonProperty(value = "subnetId", required = true) private String subnetId; /* * Gets or sets the virtual machine configuration. */ - @JsonProperty(value = "virtualMachineConfiguration", required = true) private VirtualMachineConfiguration virtualMachineConfiguration; /* * Gets or sets the disk configuration. */ - @JsonProperty(value = "dbDiskConfiguration") private DiskConfiguration dbDiskConfiguration; /* * The set of custom names to be used for underlying azure resources that are part of the SAP system. */ - @JsonProperty(value = "customResourceNames") private SingleServerCustomResourceNames customResourceNames; - /** Creates an instance of SingleServerConfiguration class. */ + /** + * Creates an instance of SingleServerConfiguration class. + */ public SingleServerConfiguration() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + @Override + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Get the networkConfiguration property: Network configuration for the server. - * + * * @return the networkConfiguration value. */ public NetworkConfiguration networkConfiguration() { @@ -69,7 +79,7 @@ public NetworkConfiguration networkConfiguration() { /** * Set the networkConfiguration property: Network configuration for the server. - * + * * @param networkConfiguration the networkConfiguration value to set. * @return the SingleServerConfiguration object itself. */ @@ -80,7 +90,7 @@ public SingleServerConfiguration withNetworkConfiguration(NetworkConfiguration n /** * Get the databaseType property: The database type. - * + * * @return the databaseType value. */ public SapDatabaseType databaseType() { @@ -89,7 +99,7 @@ public SapDatabaseType databaseType() { /** * Set the databaseType property: The database type. - * + * * @param databaseType the databaseType value to set. * @return the SingleServerConfiguration object itself. */ @@ -100,7 +110,7 @@ public SingleServerConfiguration withDatabaseType(SapDatabaseType databaseType) /** * Get the subnetId property: The subnet id. - * + * * @return the subnetId value. */ public String subnetId() { @@ -109,7 +119,7 @@ public String subnetId() { /** * Set the subnetId property: The subnet id. - * + * * @param subnetId the subnetId value to set. * @return the SingleServerConfiguration object itself. */ @@ -120,7 +130,7 @@ public SingleServerConfiguration withSubnetId(String subnetId) { /** * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @return the virtualMachineConfiguration value. */ public VirtualMachineConfiguration virtualMachineConfiguration() { @@ -129,19 +139,19 @@ public VirtualMachineConfiguration virtualMachineConfiguration() { /** * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. - * + * * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. * @return the SingleServerConfiguration object itself. */ - public SingleServerConfiguration withVirtualMachineConfiguration( - VirtualMachineConfiguration virtualMachineConfiguration) { + public SingleServerConfiguration + withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { this.virtualMachineConfiguration = virtualMachineConfiguration; return this; } /** * Get the dbDiskConfiguration property: Gets or sets the disk configuration. - * + * * @return the dbDiskConfiguration value. */ public DiskConfiguration dbDiskConfiguration() { @@ -150,7 +160,7 @@ public DiskConfiguration dbDiskConfiguration() { /** * Set the dbDiskConfiguration property: Gets or sets the disk configuration. - * + * * @param dbDiskConfiguration the dbDiskConfiguration value to set. * @return the SingleServerConfiguration object itself. */ @@ -162,7 +172,7 @@ public SingleServerConfiguration withDbDiskConfiguration(DiskConfiguration dbDis /** * Get the customResourceNames property: The set of custom names to be used for underlying azure resources that are * part of the SAP system. - * + * * @return the customResourceNames value. */ public SingleServerCustomResourceNames customResourceNames() { @@ -172,7 +182,7 @@ public SingleServerCustomResourceNames customResourceNames() { /** * Set the customResourceNames property: The set of custom names to be used for underlying azure resources that are * part of the SAP system. - * + * * @param customResourceNames the customResourceNames value to set. * @return the SingleServerConfiguration object itself. */ @@ -181,7 +191,9 @@ public SingleServerConfiguration withCustomResourceNames(SingleServerCustomResou return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SingleServerConfiguration withAppResourceGroup(String appResourceGroup) { super.withAppResourceGroup(appResourceGroup); @@ -190,7 +202,7 @@ public SingleServerConfiguration withAppResourceGroup(String appResourceGroup) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -200,16 +212,14 @@ public void validate() { networkConfiguration().validate(); } if (subnetId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property subnetId in model SingleServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subnetId in model SingleServerConfiguration")); } if (virtualMachineConfiguration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachineConfiguration in model SingleServerConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model SingleServerConfiguration")); } else { virtualMachineConfiguration().validate(); } @@ -222,4 +232,66 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SingleServerConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appResourceGroup", appResourceGroup()); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeJsonField("virtualMachineConfiguration", this.virtualMachineConfiguration); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeStringField("databaseType", this.databaseType == null ? null : this.databaseType.toString()); + jsonWriter.writeJsonField("dbDiskConfiguration", this.dbDiskConfiguration); + jsonWriter.writeJsonField("customResourceNames", this.customResourceNames); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleServerConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleServerConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SingleServerConfiguration. + */ + public static SingleServerConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleServerConfiguration deserializedSingleServerConfiguration = new SingleServerConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appResourceGroup".equals(fieldName)) { + deserializedSingleServerConfiguration.withAppResourceGroup(reader.getString()); + } else if ("subnetId".equals(fieldName)) { + deserializedSingleServerConfiguration.subnetId = reader.getString(); + } else if ("virtualMachineConfiguration".equals(fieldName)) { + deserializedSingleServerConfiguration.virtualMachineConfiguration + = VirtualMachineConfiguration.fromJson(reader); + } else if ("deploymentType".equals(fieldName)) { + deserializedSingleServerConfiguration.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("networkConfiguration".equals(fieldName)) { + deserializedSingleServerConfiguration.networkConfiguration = NetworkConfiguration.fromJson(reader); + } else if ("databaseType".equals(fieldName)) { + deserializedSingleServerConfiguration.databaseType = SapDatabaseType.fromString(reader.getString()); + } else if ("dbDiskConfiguration".equals(fieldName)) { + deserializedSingleServerConfiguration.dbDiskConfiguration = DiskConfiguration.fromJson(reader); + } else if ("customResourceNames".equals(fieldName)) { + deserializedSingleServerConfiguration.customResourceNames + = SingleServerCustomResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleServerConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerCustomResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerCustomResourceNames.java index e164e8c5dfef..98352b3f886d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerCustomResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerCustomResourceNames.java @@ -5,32 +5,107 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP * system. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "namingPatternType", - defaultImpl = SingleServerCustomResourceNames.class) -@JsonTypeName("SingleServerCustomResourceNames") -@JsonSubTypes({@JsonSubTypes.Type(name = "FullResourceName", value = SingleServerFullResourceNames.class)}) @Immutable -public class SingleServerCustomResourceNames { - /** Creates an instance of SingleServerCustomResourceNames class. */ +public class SingleServerCustomResourceNames implements JsonSerializable { + /* + * The pattern type to be used for resource naming. + */ + private NamingPatternType namingPatternType = NamingPatternType.fromString("SingleServerCustomResourceNames"); + + /** + * Creates an instance of SingleServerCustomResourceNames class. + */ public SingleServerCustomResourceNames() { } + /** + * Get the namingPatternType property: The pattern type to be used for resource naming. + * + * @return the namingPatternType value. + */ + public NamingPatternType namingPatternType() { + return this.namingPatternType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namingPatternType", + this.namingPatternType == null ? null : this.namingPatternType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleServerCustomResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleServerCustomResourceNames if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SingleServerCustomResourceNames. + */ + public static SingleServerCustomResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("namingPatternType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FullResourceName".equals(discriminatorValue)) { + return SingleServerFullResourceNames.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SingleServerCustomResourceNames fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleServerCustomResourceNames deserializedSingleServerCustomResourceNames + = new SingleServerCustomResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namingPatternType".equals(fieldName)) { + deserializedSingleServerCustomResourceNames.namingPatternType + = NamingPatternType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleServerCustomResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerFullResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerFullResourceNames.java index f2ffd25f3881..ed1502721e70 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerFullResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerFullResourceNames.java @@ -5,31 +5,46 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The resource name object where the specified values will be full resource names of the corresponding resources in a * single server SAP system. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "namingPatternType") -@JsonTypeName("FullResourceName") @Fluent public final class SingleServerFullResourceNames extends SingleServerCustomResourceNames { + /* + * The pattern type to be used for resource naming. + */ + private NamingPatternType namingPatternType = NamingPatternType.FULL_RESOURCE_NAME; + /* * The resource names object for virtual machine and related resources. */ - @JsonProperty(value = "virtualMachine") private VirtualMachineResourceNames virtualMachine; - /** Creates an instance of SingleServerFullResourceNames class. */ + /** + * Creates an instance of SingleServerFullResourceNames class. + */ public SingleServerFullResourceNames() { } + /** + * Get the namingPatternType property: The pattern type to be used for resource naming. + * + * @return the namingPatternType value. + */ + @Override + public NamingPatternType namingPatternType() { + return this.namingPatternType; + } + /** * Get the virtualMachine property: The resource names object for virtual machine and related resources. - * + * * @return the virtualMachine value. */ public VirtualMachineResourceNames virtualMachine() { @@ -38,7 +53,7 @@ public VirtualMachineResourceNames virtualMachine() { /** * Set the virtualMachine property: The resource names object for virtual machine and related resources. - * + * * @param virtualMachine the virtualMachine value to set. * @return the SingleServerFullResourceNames object itself. */ @@ -49,7 +64,7 @@ public SingleServerFullResourceNames withVirtualMachine(VirtualMachineResourceNa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -59,4 +74,47 @@ public void validate() { virtualMachine().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namingPatternType", + this.namingPatternType == null ? null : this.namingPatternType.toString()); + jsonWriter.writeJsonField("virtualMachine", this.virtualMachine); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleServerFullResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleServerFullResourceNames if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SingleServerFullResourceNames. + */ + public static SingleServerFullResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleServerFullResourceNames deserializedSingleServerFullResourceNames + = new SingleServerFullResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namingPatternType".equals(fieldName)) { + deserializedSingleServerFullResourceNames.namingPatternType + = NamingPatternType.fromString(reader.getString()); + } else if ("virtualMachine".equals(fieldName)) { + deserializedSingleServerFullResourceNames.virtualMachine + = VirtualMachineResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleServerFullResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerRecommendationResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerRecommendationResult.java index 15bd3a71f19c..b04abfa0599d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerRecommendationResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerRecommendationResult.java @@ -5,29 +5,46 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** The recommended configuration for a single server SAP system. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") -@JsonTypeName("SingleServer") +/** + * The recommended configuration for a single server SAP system. + */ @Fluent public final class SingleServerRecommendationResult extends SapSizingRecommendationResultInner { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.SINGLE_SERVER; + /* * The recommended VM SKU for single server. */ - @JsonProperty(value = "vmSku") private String vmSku; - /** Creates an instance of SingleServerRecommendationResult class. */ + /** + * Creates an instance of SingleServerRecommendationResult class. + */ public SingleServerRecommendationResult() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + @Override + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Get the vmSku property: The recommended VM SKU for single server. - * + * * @return the vmSku value. */ public String vmSku() { @@ -36,7 +53,7 @@ public String vmSku() { /** * Set the vmSku property: The recommended VM SKU for single server. - * + * * @param vmSku the vmSku value to set. * @return the SingleServerRecommendationResult object itself. */ @@ -47,11 +64,53 @@ public SingleServerRecommendationResult withVmSku(String vmSku) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("vmSku", this.vmSku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleServerRecommendationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleServerRecommendationResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SingleServerRecommendationResult. + */ + public static SingleServerRecommendationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleServerRecommendationResult deserializedSingleServerRecommendationResult + = new SingleServerRecommendationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentType".equals(fieldName)) { + deserializedSingleServerRecommendationResult.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("vmSku".equals(fieldName)) { + deserializedSingleServerRecommendationResult.vmSku = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleServerRecommendationResult; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkipFileShareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkipFileShareConfiguration.java index 38691839a8a9..793c9e3f4c08 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkipFileShareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkipFileShareConfiguration.java @@ -5,28 +5,83 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets the file share configuration for scenarios where transport directory fileshare is not created or * required. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") -@JsonTypeName("Skip") @Immutable public final class SkipFileShareConfiguration extends FileShareConfiguration { - /** Creates an instance of SkipFileShareConfiguration class. */ + /* + * The type of file share config. + */ + private ConfigurationType configurationType = ConfigurationType.SKIP; + + /** + * Creates an instance of SkipFileShareConfiguration class. + */ public SkipFileShareConfiguration() { } + /** + * Get the configurationType property: The type of file share config. + * + * @return the configurationType value. + */ + @Override + public ConfigurationType configurationType() { + return this.configurationType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configurationType", + this.configurationType == null ? null : this.configurationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkipFileShareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkipFileShareConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SkipFileShareConfiguration. + */ + public static SkipFileShareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkipFileShareConfiguration deserializedSkipFileShareConfiguration = new SkipFileShareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationType".equals(fieldName)) { + deserializedSkipFileShareConfiguration.configurationType + = ConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSkipFileShareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SoftwareConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SoftwareConfiguration.java index d3083a90f5be..c6e26c17edd9 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SoftwareConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SoftwareConfiguration.java @@ -5,35 +5,110 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The SAP Software configuration Input. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "softwareInstallationType", - defaultImpl = SoftwareConfiguration.class) -@JsonTypeName("SoftwareConfiguration") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "ServiceInitiated", value = ServiceInitiatedSoftwareConfiguration.class), - @JsonSubTypes.Type( - name = "SAPInstallWithoutOSConfig", - value = SapInstallWithoutOSConfigSoftwareConfiguration.class), - @JsonSubTypes.Type(name = "External", value = ExternalInstallationSoftwareConfiguration.class) -}) +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SAP Software configuration Input. + */ @Immutable -public class SoftwareConfiguration { - /** Creates an instance of SoftwareConfiguration class. */ +public class SoftwareConfiguration implements JsonSerializable { + /* + * The SAP software installation Type. + */ + private SapSoftwareInstallationType softwareInstallationType + = SapSoftwareInstallationType.fromString("SoftwareConfiguration"); + + /** + * Creates an instance of SoftwareConfiguration class. + */ public SoftwareConfiguration() { } + /** + * Get the softwareInstallationType property: The SAP software installation Type. + * + * @return the softwareInstallationType value. + */ + public SapSoftwareInstallationType softwareInstallationType() { + return this.softwareInstallationType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("softwareInstallationType", + this.softwareInstallationType == null ? null : this.softwareInstallationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftwareConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftwareConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftwareConfiguration. + */ + public static SoftwareConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("softwareInstallationType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ServiceInitiated".equals(discriminatorValue)) { + return ServiceInitiatedSoftwareConfiguration.fromJson(readerToUse.reset()); + } else if ("SAPInstallWithoutOSConfig".equals(discriminatorValue)) { + return SapInstallWithoutOSConfigSoftwareConfiguration.fromJson(readerToUse.reset()); + } else if ("External".equals(discriminatorValue)) { + return ExternalInstallationSoftwareConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SoftwareConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftwareConfiguration deserializedSoftwareConfiguration = new SoftwareConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softwareInstallationType".equals(fieldName)) { + deserializedSoftwareConfiguration.softwareInstallationType + = SapSoftwareInstallationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftwareConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshConfiguration.java index f8b18d45402d..c89aea041ecb 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshConfiguration.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** SSH configuration for Linux based VMs running on Azure. */ +/** + * SSH configuration for Linux based VMs running on Azure. + */ @Fluent -public final class SshConfiguration { +public final class SshConfiguration implements JsonSerializable { /* * The list of SSH public keys used to authenticate with linux based VMs. */ - @JsonProperty(value = "publicKeys") private List publicKeys; - /** Creates an instance of SshConfiguration class. */ + /** + * Creates an instance of SshConfiguration class. + */ public SshConfiguration() { } /** * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * + * * @return the publicKeys value. */ public List publicKeys() { @@ -32,7 +39,7 @@ public List publicKeys() { /** * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. - * + * * @param publicKeys the publicKeys value to set. * @return the SshConfiguration object itself. */ @@ -43,7 +50,7 @@ public SshConfiguration withPublicKeys(List publicKeys) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,41 @@ public void validate() { publicKeys().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicKeys", this.publicKeys, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshConfiguration. + */ + public static SshConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshConfiguration deserializedSshConfiguration = new SshConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKeys".equals(fieldName)) { + List publicKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedSshConfiguration.publicKeys = publicKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedSshConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshKeyPair.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshKeyPair.java index 47c261261b1e..4bed5f41238c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshKeyPair.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshKeyPair.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. @@ -13,26 +17,26 @@ * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). */ @Fluent -public final class SshKeyPair { +public final class SshKeyPair implements JsonSerializable { /* * SSH public key */ - @JsonProperty(value = "publicKey") private String publicKey; /* * SSH private key. */ - @JsonProperty(value = "privateKey") private String privateKey; - /** Creates an instance of SshKeyPair class. */ + /** + * Creates an instance of SshKeyPair class. + */ public SshKeyPair() { } /** * Get the publicKey property: SSH public key. - * + * * @return the publicKey value. */ public String publicKey() { @@ -41,7 +45,7 @@ public String publicKey() { /** * Set the publicKey property: SSH public key. - * + * * @param publicKey the publicKey value to set. * @return the SshKeyPair object itself. */ @@ -52,7 +56,7 @@ public SshKeyPair withPublicKey(String publicKey) { /** * Get the privateKey property: SSH private key. - * + * * @return the privateKey value. */ public String privateKey() { @@ -61,7 +65,7 @@ public String privateKey() { /** * Set the privateKey property: SSH private key. - * + * * @param privateKey the privateKey value to set. * @return the SshKeyPair object itself. */ @@ -72,9 +76,48 @@ public SshKeyPair withPrivateKey(String privateKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicKey", this.publicKey); + jsonWriter.writeStringField("privateKey", this.privateKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshKeyPair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshKeyPair if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SshKeyPair. + */ + public static SshKeyPair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshKeyPair deserializedSshKeyPair = new SshKeyPair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicKey".equals(fieldName)) { + deserializedSshKeyPair.publicKey = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedSshKeyPair.privateKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshKeyPair; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshPublicKey.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshPublicKey.java index 01c019b8216b..69bbc4c1b1e3 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshPublicKey.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshPublicKey.java @@ -5,22 +5,27 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. */ @Fluent -public final class SshPublicKey { +public final class SshPublicKey implements JsonSerializable { /* * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit * and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). */ - @JsonProperty(value = "keyData") private String keyData; - /** Creates an instance of SshPublicKey class. */ + /** + * Creates an instance of SshPublicKey class. + */ public SshPublicKey() { } @@ -29,7 +34,7 @@ public SshPublicKey() { * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys * on Linux and Mac for Linux VMs in * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - * + * * @return the keyData value. */ public String keyData() { @@ -41,7 +46,7 @@ public String keyData() { * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys * on Linux and Mac for Linux VMs in * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - * + * * @param keyData the keyData value to set. * @return the SshPublicKey object itself. */ @@ -52,9 +57,45 @@ public SshPublicKey withKeyData(String keyData) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyData", this.keyData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyData".equals(fieldName)) { + deserializedSshPublicKey.keyData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SslPreference.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SslPreference.java index ed498983db09..d6ae6c1b576d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SslPreference.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SslPreference.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Gets or sets certificate preference if secure communication is enabled. */ +/** + * Gets or sets certificate preference if secure communication is enabled. + */ public final class SslPreference extends ExpandableStringEnum { - /** Static value Disabled for SslPreference. */ + /** + * Static value Disabled for SslPreference. + */ public static final SslPreference DISABLED = fromString("Disabled"); - /** Static value RootCertificate for SslPreference. */ + /** + * Static value RootCertificate for SslPreference. + */ public static final SslPreference ROOT_CERTIFICATE = fromString("RootCertificate"); - /** Static value ServerCertificate for SslPreference. */ + /** + * Static value ServerCertificate for SslPreference. + */ public static final SslPreference SERVER_CERTIFICATE = fromString("ServerCertificate"); /** * Creates a new instance of SslPreference value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SslPreference() { /** * Creates or finds a SslPreference from its string representation. - * + * * @param name a name to look for. * @return the corresponding SslPreference. */ - @JsonCreator public static SslPreference fromString(String name) { return fromString(name, SslPreference.class); } /** * Gets known SslPreference values. - * + * * @return known SslPreference values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StopRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StopRequest.java index 9bd9ee6e2215..55c7ff6dd2cf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StopRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StopRequest.java @@ -5,20 +5,27 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Stop SAP instance(s) request body. */ +/** + * Stop SAP instance(s) request body. + */ @Fluent -public final class StopRequest { +public final class StopRequest implements JsonSerializable { /* * This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer - * consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes - * directly into the next shutdown state, i.e. hard stop. + * consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes directly + * into the next shutdown state, i.e. hard stop. */ - @JsonProperty(value = "softStopTimeoutSeconds") private Long softStopTimeoutSeconds; - /** Creates an instance of StopRequest class. */ + /** + * Creates an instance of StopRequest class. + */ public StopRequest() { } @@ -26,7 +33,7 @@ public StopRequest() { * Get the softStopTimeoutSeconds property: This parameter defines how long (in seconds) the soft shutdown waits * until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the * kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. - * + * * @return the softStopTimeoutSeconds value. */ public Long softStopTimeoutSeconds() { @@ -37,7 +44,7 @@ public Long softStopTimeoutSeconds() { * Set the softStopTimeoutSeconds property: This parameter defines how long (in seconds) the soft shutdown waits * until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the * kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. - * + * * @param softStopTimeoutSeconds the softStopTimeoutSeconds value to set. * @return the StopRequest object itself. */ @@ -48,9 +55,45 @@ public StopRequest withSoftStopTimeoutSeconds(Long softStopTimeoutSeconds) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("softStopTimeoutSeconds", this.softStopTimeoutSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StopRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StopRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StopRequest. + */ + public static StopRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StopRequest deserializedStopRequest = new StopRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("softStopTimeoutSeconds".equals(fieldName)) { + deserializedStopRequest.softStopTimeoutSeconds = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedStopRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageConfiguration.java index 5a18aff2b593..2c632c5a71c3 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageConfiguration.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Gets or sets the storage configuration. */ +/** + * Gets or sets the storage configuration. + */ @Fluent -public final class StorageConfiguration { +public final class StorageConfiguration implements JsonSerializable { /* - * The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration - * is the createAndMount flow if storage configuration is missing. + * The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is + * the createAndMount flow if storage configuration is missing. */ - @JsonProperty(value = "transportFileShareConfiguration") private FileShareConfiguration transportFileShareConfiguration; - /** Creates an instance of StorageConfiguration class. */ + /** + * Creates an instance of StorageConfiguration class. + */ public StorageConfiguration() { } /** * Get the transportFileShareConfiguration property: The properties of the transport directory attached to the VIS. * The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. - * + * * @return the transportFileShareConfiguration value. */ public FileShareConfiguration transportFileShareConfiguration() { @@ -34,19 +41,19 @@ public FileShareConfiguration transportFileShareConfiguration() { /** * Set the transportFileShareConfiguration property: The properties of the transport directory attached to the VIS. * The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. - * + * * @param transportFileShareConfiguration the transportFileShareConfiguration value to set. * @return the StorageConfiguration object itself. */ - public StorageConfiguration withTransportFileShareConfiguration( - FileShareConfiguration transportFileShareConfiguration) { + public StorageConfiguration + withTransportFileShareConfiguration(FileShareConfiguration transportFileShareConfiguration) { this.transportFileShareConfiguration = transportFileShareConfiguration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -54,4 +61,41 @@ public void validate() { transportFileShareConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("transportFileShareConfiguration", this.transportFileShareConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageConfiguration. + */ + public static StorageConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageConfiguration deserializedStorageConfiguration = new StorageConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("transportFileShareConfiguration".equals(fieldName)) { + deserializedStorageConfiguration.transportFileShareConfiguration + = FileShareConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageInformation.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageInformation.java index b3a8c168102b..7dc00676a53f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageInformation.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StorageInformation.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. */ +/** + * Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. + */ @Immutable -public final class StorageInformation { +public final class StorageInformation implements JsonSerializable { /* * The id property. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of StorageInformation class. */ + /** + * Creates an instance of StorageInformation class. + */ public StorageInformation() { } /** * Get the id property: The id property. - * + * * @return the id value. */ public String id() { @@ -31,9 +38,44 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageInformation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageInformation. + */ + public static StorageInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageInformation deserializedStorageInformation = new StorageInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageInformation.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageInformation; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierConfiguration.java index c1ffbb51849d..766547e8ab71 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierConfiguration.java @@ -6,67 +6,76 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Gets or sets the three tier SAP configuration. For prerequisites for creating the infrastructure, please see * [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") -@JsonTypeName("ThreeTier") @Fluent public final class ThreeTierConfiguration extends InfrastructureConfiguration { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.THREE_TIER; + /* * Network configuration common to all servers */ - @JsonProperty(value = "networkConfiguration") private NetworkConfiguration networkConfiguration; /* * The central server configuration. */ - @JsonProperty(value = "centralServer", required = true) private CentralServerConfiguration centralServer; /* * The application server configuration. */ - @JsonProperty(value = "applicationServer", required = true) private ApplicationServerConfiguration applicationServer; /* * The database configuration. */ - @JsonProperty(value = "databaseServer", required = true) private DatabaseConfiguration databaseServer; /* * The high availability configuration. */ - @JsonProperty(value = "highAvailabilityConfig") private HighAvailabilityConfiguration highAvailabilityConfig; /* * The storage configuration. */ - @JsonProperty(value = "storageConfiguration") private StorageConfiguration storageConfiguration; /* * The set of custom names to be used for underlying azure resources that are part of the SAP system. */ - @JsonProperty(value = "customResourceNames") private ThreeTierCustomResourceNames customResourceNames; - /** Creates an instance of ThreeTierConfiguration class. */ + /** + * Creates an instance of ThreeTierConfiguration class. + */ public ThreeTierConfiguration() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + @Override + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Get the networkConfiguration property: Network configuration common to all servers. - * + * * @return the networkConfiguration value. */ public NetworkConfiguration networkConfiguration() { @@ -75,7 +84,7 @@ public NetworkConfiguration networkConfiguration() { /** * Set the networkConfiguration property: Network configuration common to all servers. - * + * * @param networkConfiguration the networkConfiguration value to set. * @return the ThreeTierConfiguration object itself. */ @@ -86,7 +95,7 @@ public ThreeTierConfiguration withNetworkConfiguration(NetworkConfiguration netw /** * Get the centralServer property: The central server configuration. - * + * * @return the centralServer value. */ public CentralServerConfiguration centralServer() { @@ -95,7 +104,7 @@ public CentralServerConfiguration centralServer() { /** * Set the centralServer property: The central server configuration. - * + * * @param centralServer the centralServer value to set. * @return the ThreeTierConfiguration object itself. */ @@ -106,7 +115,7 @@ public ThreeTierConfiguration withCentralServer(CentralServerConfiguration centr /** * Get the applicationServer property: The application server configuration. - * + * * @return the applicationServer value. */ public ApplicationServerConfiguration applicationServer() { @@ -115,7 +124,7 @@ public ApplicationServerConfiguration applicationServer() { /** * Set the applicationServer property: The application server configuration. - * + * * @param applicationServer the applicationServer value to set. * @return the ThreeTierConfiguration object itself. */ @@ -126,7 +135,7 @@ public ThreeTierConfiguration withApplicationServer(ApplicationServerConfigurati /** * Get the databaseServer property: The database configuration. - * + * * @return the databaseServer value. */ public DatabaseConfiguration databaseServer() { @@ -135,7 +144,7 @@ public DatabaseConfiguration databaseServer() { /** * Set the databaseServer property: The database configuration. - * + * * @param databaseServer the databaseServer value to set. * @return the ThreeTierConfiguration object itself. */ @@ -146,7 +155,7 @@ public ThreeTierConfiguration withDatabaseServer(DatabaseConfiguration databaseS /** * Get the highAvailabilityConfig property: The high availability configuration. - * + * * @return the highAvailabilityConfig value. */ public HighAvailabilityConfiguration highAvailabilityConfig() { @@ -155,7 +164,7 @@ public HighAvailabilityConfiguration highAvailabilityConfig() { /** * Set the highAvailabilityConfig property: The high availability configuration. - * + * * @param highAvailabilityConfig the highAvailabilityConfig value to set. * @return the ThreeTierConfiguration object itself. */ @@ -166,7 +175,7 @@ public ThreeTierConfiguration withHighAvailabilityConfig(HighAvailabilityConfigu /** * Get the storageConfiguration property: The storage configuration. - * + * * @return the storageConfiguration value. */ public StorageConfiguration storageConfiguration() { @@ -175,7 +184,7 @@ public StorageConfiguration storageConfiguration() { /** * Set the storageConfiguration property: The storage configuration. - * + * * @param storageConfiguration the storageConfiguration value to set. * @return the ThreeTierConfiguration object itself. */ @@ -187,7 +196,7 @@ public ThreeTierConfiguration withStorageConfiguration(StorageConfiguration stor /** * Get the customResourceNames property: The set of custom names to be used for underlying azure resources that are * part of the SAP system. - * + * * @return the customResourceNames value. */ public ThreeTierCustomResourceNames customResourceNames() { @@ -197,7 +206,7 @@ public ThreeTierCustomResourceNames customResourceNames() { /** * Set the customResourceNames property: The set of custom names to be used for underlying azure resources that are * part of the SAP system. - * + * * @param customResourceNames the customResourceNames value to set. * @return the ThreeTierConfiguration object itself. */ @@ -206,7 +215,9 @@ public ThreeTierConfiguration withCustomResourceNames(ThreeTierCustomResourceNam return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ThreeTierConfiguration withAppResourceGroup(String appResourceGroup) { super.withAppResourceGroup(appResourceGroup); @@ -215,7 +226,7 @@ public ThreeTierConfiguration withAppResourceGroup(String appResourceGroup) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -225,26 +236,23 @@ public void validate() { networkConfiguration().validate(); } if (centralServer() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property centralServer in model ThreeTierConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property centralServer in model ThreeTierConfiguration")); } else { centralServer().validate(); } if (applicationServer() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property applicationServer in model ThreeTierConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property applicationServer in model ThreeTierConfiguration")); } else { applicationServer().validate(); } if (databaseServer() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property databaseServer in model ThreeTierConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseServer in model ThreeTierConfiguration")); } else { databaseServer().validate(); } @@ -260,4 +268,70 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ThreeTierConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appResourceGroup", appResourceGroup()); + jsonWriter.writeJsonField("centralServer", this.centralServer); + jsonWriter.writeJsonField("applicationServer", this.applicationServer); + jsonWriter.writeJsonField("databaseServer", this.databaseServer); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeJsonField("highAvailabilityConfig", this.highAvailabilityConfig); + jsonWriter.writeJsonField("storageConfiguration", this.storageConfiguration); + jsonWriter.writeJsonField("customResourceNames", this.customResourceNames); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreeTierConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreeTierConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreeTierConfiguration. + */ + public static ThreeTierConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreeTierConfiguration deserializedThreeTierConfiguration = new ThreeTierConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appResourceGroup".equals(fieldName)) { + deserializedThreeTierConfiguration.withAppResourceGroup(reader.getString()); + } else if ("centralServer".equals(fieldName)) { + deserializedThreeTierConfiguration.centralServer = CentralServerConfiguration.fromJson(reader); + } else if ("applicationServer".equals(fieldName)) { + deserializedThreeTierConfiguration.applicationServer + = ApplicationServerConfiguration.fromJson(reader); + } else if ("databaseServer".equals(fieldName)) { + deserializedThreeTierConfiguration.databaseServer = DatabaseConfiguration.fromJson(reader); + } else if ("deploymentType".equals(fieldName)) { + deserializedThreeTierConfiguration.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("networkConfiguration".equals(fieldName)) { + deserializedThreeTierConfiguration.networkConfiguration = NetworkConfiguration.fromJson(reader); + } else if ("highAvailabilityConfig".equals(fieldName)) { + deserializedThreeTierConfiguration.highAvailabilityConfig + = HighAvailabilityConfiguration.fromJson(reader); + } else if ("storageConfiguration".equals(fieldName)) { + deserializedThreeTierConfiguration.storageConfiguration = StorageConfiguration.fromJson(reader); + } else if ("customResourceNames".equals(fieldName)) { + deserializedThreeTierConfiguration.customResourceNames + = ThreeTierCustomResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThreeTierConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierCustomResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierCustomResourceNames.java index 5b0e47e27d48..640aba5b5176 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierCustomResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierCustomResourceNames.java @@ -5,32 +5,106 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP * system. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "namingPatternType", - defaultImpl = ThreeTierCustomResourceNames.class) -@JsonTypeName("ThreeTierCustomResourceNames") -@JsonSubTypes({@JsonSubTypes.Type(name = "FullResourceName", value = ThreeTierFullResourceNames.class)}) @Immutable -public class ThreeTierCustomResourceNames { - /** Creates an instance of ThreeTierCustomResourceNames class. */ +public class ThreeTierCustomResourceNames implements JsonSerializable { + /* + * The pattern type to be used for resource naming. + */ + private NamingPatternType namingPatternType = NamingPatternType.fromString("ThreeTierCustomResourceNames"); + + /** + * Creates an instance of ThreeTierCustomResourceNames class. + */ public ThreeTierCustomResourceNames() { } + /** + * Get the namingPatternType property: The pattern type to be used for resource naming. + * + * @return the namingPatternType value. + */ + public NamingPatternType namingPatternType() { + return this.namingPatternType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namingPatternType", + this.namingPatternType == null ? null : this.namingPatternType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreeTierCustomResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreeTierCustomResourceNames if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThreeTierCustomResourceNames. + */ + public static ThreeTierCustomResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("namingPatternType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FullResourceName".equals(discriminatorValue)) { + return ThreeTierFullResourceNames.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ThreeTierCustomResourceNames fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreeTierCustomResourceNames deserializedThreeTierCustomResourceNames = new ThreeTierCustomResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namingPatternType".equals(fieldName)) { + deserializedThreeTierCustomResourceNames.namingPatternType + = NamingPatternType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedThreeTierCustomResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierFullResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierFullResourceNames.java index 47296846a74c..4d6ada72f1cb 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierFullResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierFullResourceNames.java @@ -5,51 +5,63 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The resource name object where the specified values will be full resource names of the corresponding resources in a * three tier SAP system. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "namingPatternType") -@JsonTypeName("FullResourceName") @Fluent public final class ThreeTierFullResourceNames extends ThreeTierCustomResourceNames { + /* + * The pattern type to be used for resource naming. + */ + private NamingPatternType namingPatternType = NamingPatternType.FULL_RESOURCE_NAME; + /* * The full resource names object for central server layer resources. */ - @JsonProperty(value = "centralServer") private CentralServerFullResourceNames centralServer; /* * The full resource names object for application layer resources. The number of entries in this list should be * equal to the number VMs to be created for application layer. */ - @JsonProperty(value = "applicationServer") private ApplicationServerFullResourceNames applicationServer; /* * The full resource names object for database layer resources. The number of entries in this list should be equal * to the number VMs to be created for database layer. */ - @JsonProperty(value = "databaseServer") private DatabaseServerFullResourceNames databaseServer; /* * The resource names object for shared storage. */ - @JsonProperty(value = "sharedStorage") private SharedStorageResourceNames sharedStorage; - /** Creates an instance of ThreeTierFullResourceNames class. */ + /** + * Creates an instance of ThreeTierFullResourceNames class. + */ public ThreeTierFullResourceNames() { } + /** + * Get the namingPatternType property: The pattern type to be used for resource naming. + * + * @return the namingPatternType value. + */ + @Override + public NamingPatternType namingPatternType() { + return this.namingPatternType; + } + /** * Get the centralServer property: The full resource names object for central server layer resources. - * + * * @return the centralServer value. */ public CentralServerFullResourceNames centralServer() { @@ -58,7 +70,7 @@ public CentralServerFullResourceNames centralServer() { /** * Set the centralServer property: The full resource names object for central server layer resources. - * + * * @param centralServer the centralServer value to set. * @return the ThreeTierFullResourceNames object itself. */ @@ -70,7 +82,7 @@ public ThreeTierFullResourceNames withCentralServer(CentralServerFullResourceNam /** * Get the applicationServer property: The full resource names object for application layer resources. The number of * entries in this list should be equal to the number VMs to be created for application layer. - * + * * @return the applicationServer value. */ public ApplicationServerFullResourceNames applicationServer() { @@ -80,7 +92,7 @@ public ApplicationServerFullResourceNames applicationServer() { /** * Set the applicationServer property: The full resource names object for application layer resources. The number of * entries in this list should be equal to the number VMs to be created for application layer. - * + * * @param applicationServer the applicationServer value to set. * @return the ThreeTierFullResourceNames object itself. */ @@ -92,7 +104,7 @@ public ThreeTierFullResourceNames withApplicationServer(ApplicationServerFullRes /** * Get the databaseServer property: The full resource names object for database layer resources. The number of * entries in this list should be equal to the number VMs to be created for database layer. - * + * * @return the databaseServer value. */ public DatabaseServerFullResourceNames databaseServer() { @@ -102,7 +114,7 @@ public DatabaseServerFullResourceNames databaseServer() { /** * Set the databaseServer property: The full resource names object for database layer resources. The number of * entries in this list should be equal to the number VMs to be created for database layer. - * + * * @param databaseServer the databaseServer value to set. * @return the ThreeTierFullResourceNames object itself. */ @@ -113,7 +125,7 @@ public ThreeTierFullResourceNames withDatabaseServer(DatabaseServerFullResourceN /** * Get the sharedStorage property: The resource names object for shared storage. - * + * * @return the sharedStorage value. */ public SharedStorageResourceNames sharedStorage() { @@ -122,7 +134,7 @@ public SharedStorageResourceNames sharedStorage() { /** * Set the sharedStorage property: The resource names object for shared storage. - * + * * @param sharedStorage the sharedStorage value to set. * @return the ThreeTierFullResourceNames object itself. */ @@ -133,7 +145,7 @@ public ThreeTierFullResourceNames withSharedStorage(SharedStorageResourceNames s /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -152,4 +164,57 @@ public void validate() { sharedStorage().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namingPatternType", + this.namingPatternType == null ? null : this.namingPatternType.toString()); + jsonWriter.writeJsonField("centralServer", this.centralServer); + jsonWriter.writeJsonField("applicationServer", this.applicationServer); + jsonWriter.writeJsonField("databaseServer", this.databaseServer); + jsonWriter.writeJsonField("sharedStorage", this.sharedStorage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreeTierFullResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreeTierFullResourceNames if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThreeTierFullResourceNames. + */ + public static ThreeTierFullResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreeTierFullResourceNames deserializedThreeTierFullResourceNames = new ThreeTierFullResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namingPatternType".equals(fieldName)) { + deserializedThreeTierFullResourceNames.namingPatternType + = NamingPatternType.fromString(reader.getString()); + } else if ("centralServer".equals(fieldName)) { + deserializedThreeTierFullResourceNames.centralServer + = CentralServerFullResourceNames.fromJson(reader); + } else if ("applicationServer".equals(fieldName)) { + deserializedThreeTierFullResourceNames.applicationServer + = ApplicationServerFullResourceNames.fromJson(reader); + } else if ("databaseServer".equals(fieldName)) { + deserializedThreeTierFullResourceNames.databaseServer + = DatabaseServerFullResourceNames.fromJson(reader); + } else if ("sharedStorage".equals(fieldName)) { + deserializedThreeTierFullResourceNames.sharedStorage = SharedStorageResourceNames.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThreeTierFullResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierRecommendationResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierRecommendationResult.java index d72b329df605..6ff2800d3cd6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierRecommendationResult.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierRecommendationResult.java @@ -5,59 +5,71 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.IOException; -/** The recommended configuration for a three tier SAP system. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") -@JsonTypeName("ThreeTier") +/** + * The recommended configuration for a three tier SAP system. + */ @Fluent public final class ThreeTierRecommendationResult extends SapSizingRecommendationResultInner { + /* + * The type of SAP deployment, single server or Three tier. + */ + private SapDeploymentType deploymentType = SapDeploymentType.THREE_TIER; + /* * The database VM SKU. */ - @JsonProperty(value = "dbVmSku") private String dbVmSku; /* * The database server instance count. */ - @JsonProperty(value = "databaseInstanceCount") private Long databaseInstanceCount; /* * The central server VM SKU. */ - @JsonProperty(value = "centralServerVmSku") private String centralServerVmSku; /* * The central server instance count. */ - @JsonProperty(value = "centralServerInstanceCount") private Long centralServerInstanceCount; /* * The application server VM SKU. */ - @JsonProperty(value = "applicationServerVmSku") private String applicationServerVmSku; /* * The application server instance count. */ - @JsonProperty(value = "applicationServerInstanceCount") private Long applicationServerInstanceCount; - /** Creates an instance of ThreeTierRecommendationResult class. */ + /** + * Creates an instance of ThreeTierRecommendationResult class. + */ public ThreeTierRecommendationResult() { } + /** + * Get the deploymentType property: The type of SAP deployment, single server or Three tier. + * + * @return the deploymentType value. + */ + @Override + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + /** * Get the dbVmSku property: The database VM SKU. - * + * * @return the dbVmSku value. */ public String dbVmSku() { @@ -66,7 +78,7 @@ public String dbVmSku() { /** * Set the dbVmSku property: The database VM SKU. - * + * * @param dbVmSku the dbVmSku value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -77,7 +89,7 @@ public ThreeTierRecommendationResult withDbVmSku(String dbVmSku) { /** * Get the databaseInstanceCount property: The database server instance count. - * + * * @return the databaseInstanceCount value. */ public Long databaseInstanceCount() { @@ -86,7 +98,7 @@ public Long databaseInstanceCount() { /** * Set the databaseInstanceCount property: The database server instance count. - * + * * @param databaseInstanceCount the databaseInstanceCount value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -97,7 +109,7 @@ public ThreeTierRecommendationResult withDatabaseInstanceCount(Long databaseInst /** * Get the centralServerVmSku property: The central server VM SKU. - * + * * @return the centralServerVmSku value. */ public String centralServerVmSku() { @@ -106,7 +118,7 @@ public String centralServerVmSku() { /** * Set the centralServerVmSku property: The central server VM SKU. - * + * * @param centralServerVmSku the centralServerVmSku value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -117,7 +129,7 @@ public ThreeTierRecommendationResult withCentralServerVmSku(String centralServer /** * Get the centralServerInstanceCount property: The central server instance count. - * + * * @return the centralServerInstanceCount value. */ public Long centralServerInstanceCount() { @@ -126,7 +138,7 @@ public Long centralServerInstanceCount() { /** * Set the centralServerInstanceCount property: The central server instance count. - * + * * @param centralServerInstanceCount the centralServerInstanceCount value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -137,7 +149,7 @@ public ThreeTierRecommendationResult withCentralServerInstanceCount(Long central /** * Get the applicationServerVmSku property: The application server VM SKU. - * + * * @return the applicationServerVmSku value. */ public String applicationServerVmSku() { @@ -146,7 +158,7 @@ public String applicationServerVmSku() { /** * Set the applicationServerVmSku property: The application server VM SKU. - * + * * @param applicationServerVmSku the applicationServerVmSku value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -157,7 +169,7 @@ public ThreeTierRecommendationResult withApplicationServerVmSku(String applicati /** * Get the applicationServerInstanceCount property: The application server instance count. - * + * * @return the applicationServerInstanceCount value. */ public Long applicationServerInstanceCount() { @@ -166,7 +178,7 @@ public Long applicationServerInstanceCount() { /** * Set the applicationServerInstanceCount property: The application server instance count. - * + * * @param applicationServerInstanceCount the applicationServerInstanceCount value to set. * @return the ThreeTierRecommendationResult object itself. */ @@ -177,11 +189,71 @@ public ThreeTierRecommendationResult withApplicationServerInstanceCount(Long app /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("dbVmSku", this.dbVmSku); + jsonWriter.writeNumberField("databaseInstanceCount", this.databaseInstanceCount); + jsonWriter.writeStringField("centralServerVmSku", this.centralServerVmSku); + jsonWriter.writeNumberField("centralServerInstanceCount", this.centralServerInstanceCount); + jsonWriter.writeStringField("applicationServerVmSku", this.applicationServerVmSku); + jsonWriter.writeNumberField("applicationServerInstanceCount", this.applicationServerInstanceCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreeTierRecommendationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreeTierRecommendationResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThreeTierRecommendationResult. + */ + public static ThreeTierRecommendationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreeTierRecommendationResult deserializedThreeTierRecommendationResult + = new ThreeTierRecommendationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentType".equals(fieldName)) { + deserializedThreeTierRecommendationResult.deploymentType + = SapDeploymentType.fromString(reader.getString()); + } else if ("dbVmSku".equals(fieldName)) { + deserializedThreeTierRecommendationResult.dbVmSku = reader.getString(); + } else if ("databaseInstanceCount".equals(fieldName)) { + deserializedThreeTierRecommendationResult.databaseInstanceCount + = reader.getNullable(JsonReader::getLong); + } else if ("centralServerVmSku".equals(fieldName)) { + deserializedThreeTierRecommendationResult.centralServerVmSku = reader.getString(); + } else if ("centralServerInstanceCount".equals(fieldName)) { + deserializedThreeTierRecommendationResult.centralServerInstanceCount + = reader.getNullable(JsonReader::getLong); + } else if ("applicationServerVmSku".equals(fieldName)) { + deserializedThreeTierRecommendationResult.applicationServerVmSku = reader.getString(); + } else if ("applicationServerInstanceCount".equals(fieldName)) { + deserializedThreeTierRecommendationResult.applicationServerInstanceCount + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedThreeTierRecommendationResult; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateMonitorRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateMonitorRequest.java index 368fc2712dff..aebf69983cea 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateMonitorRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateMonitorRequest.java @@ -5,33 +5,37 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Defines the request body for updating SAP monitor resource. */ +/** + * Defines the request body for updating SAP monitor resource. + */ @Fluent -public final class UpdateMonitorRequest { +public final class UpdateMonitorRequest implements JsonSerializable { /* * Gets or sets the Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * [currently not in use] Managed service identity(user assigned identities) */ - @JsonProperty(value = "identity") private UserAssignedServiceIdentity identity; - /** Creates an instance of UpdateMonitorRequest class. */ + /** + * Creates an instance of UpdateMonitorRequest class. + */ public UpdateMonitorRequest() { } /** * Get the tags property: Gets or sets the Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -40,7 +44,7 @@ public Map tags() { /** * Set the tags property: Gets or sets the Resource tags. - * + * * @param tags the tags value to set. * @return the UpdateMonitorRequest object itself. */ @@ -51,7 +55,7 @@ public UpdateMonitorRequest withTags(Map tags) { /** * Get the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @return the identity value. */ public UserAssignedServiceIdentity identity() { @@ -60,7 +64,7 @@ public UserAssignedServiceIdentity identity() { /** * Set the identity property: [currently not in use] Managed service identity(user assigned identities). - * + * * @param identity the identity value to set. * @return the UpdateMonitorRequest object itself. */ @@ -71,7 +75,7 @@ public UpdateMonitorRequest withIdentity(UserAssignedServiceIdentity identity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +83,44 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateMonitorRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateMonitorRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateMonitorRequest. + */ + public static UpdateMonitorRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateMonitorRequest deserializedUpdateMonitorRequest = new UpdateMonitorRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateMonitorRequest.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedUpdateMonitorRequest.identity = UserAssignedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateMonitorRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapApplicationInstanceRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapApplicationInstanceRequest.java index 2078f28cf879..b4ac3a6b1317 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapApplicationInstanceRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapApplicationInstanceRequest.java @@ -5,27 +5,33 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Defines the request body for updating SAP Application Instance. */ +/** + * Defines the request body for updating SAP Application Instance. + */ @Fluent -public final class UpdateSapApplicationInstanceRequest { +public final class UpdateSapApplicationInstanceRequest + implements JsonSerializable { /* * Gets or sets the Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of UpdateSapApplicationInstanceRequest class. */ + /** + * Creates an instance of UpdateSapApplicationInstanceRequest class. + */ public UpdateSapApplicationInstanceRequest() { } /** * Get the tags property: Gets or sets the Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +40,7 @@ public Map tags() { /** * Set the tags property: Gets or sets the Resource tags. - * + * * @param tags the tags value to set. * @return the UpdateSapApplicationInstanceRequest object itself. */ @@ -45,9 +51,47 @@ public UpdateSapApplicationInstanceRequest withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSapApplicationInstanceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSapApplicationInstanceRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateSapApplicationInstanceRequest. + */ + public static UpdateSapApplicationInstanceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSapApplicationInstanceRequest deserializedUpdateSapApplicationInstanceRequest + = new UpdateSapApplicationInstanceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateSapApplicationInstanceRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSapApplicationInstanceRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapCentralInstanceRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapCentralInstanceRequest.java index 9430f8a2b61a..a46ea3235f38 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapCentralInstanceRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapCentralInstanceRequest.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Defines the request body for updating SAP Central Instance. */ +/** + * Defines the request body for updating SAP Central Instance. + */ @Fluent -public final class UpdateSapCentralInstanceRequest { +public final class UpdateSapCentralInstanceRequest implements JsonSerializable { /* * Gets or sets the Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of UpdateSapCentralInstanceRequest class. */ + /** + * Creates an instance of UpdateSapCentralInstanceRequest class. + */ public UpdateSapCentralInstanceRequest() { } /** * Get the tags property: Gets or sets the Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Gets or sets the Resource tags. - * + * * @param tags the tags value to set. * @return the UpdateSapCentralInstanceRequest object itself. */ @@ -45,9 +50,47 @@ public UpdateSapCentralInstanceRequest withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSapCentralInstanceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSapCentralInstanceRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateSapCentralInstanceRequest. + */ + public static UpdateSapCentralInstanceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSapCentralInstanceRequest deserializedUpdateSapCentralInstanceRequest + = new UpdateSapCentralInstanceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateSapCentralInstanceRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSapCentralInstanceRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapDatabaseInstanceRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapDatabaseInstanceRequest.java index 833459dea284..b1eb6cb8ed4b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapDatabaseInstanceRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapDatabaseInstanceRequest.java @@ -5,27 +5,32 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Defines the request body for updating SAP Database Instance. */ +/** + * Defines the request body for updating SAP Database Instance. + */ @Fluent -public final class UpdateSapDatabaseInstanceRequest { +public final class UpdateSapDatabaseInstanceRequest implements JsonSerializable { /* * Gets or sets the Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of UpdateSapDatabaseInstanceRequest class. */ + /** + * Creates an instance of UpdateSapDatabaseInstanceRequest class. + */ public UpdateSapDatabaseInstanceRequest() { } /** * Get the tags property: Gets or sets the Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +39,7 @@ public Map tags() { /** * Set the tags property: Gets or sets the Resource tags. - * + * * @param tags the tags value to set. * @return the UpdateSapDatabaseInstanceRequest object itself. */ @@ -45,9 +50,47 @@ public UpdateSapDatabaseInstanceRequest withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSapDatabaseInstanceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSapDatabaseInstanceRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateSapDatabaseInstanceRequest. + */ + public static UpdateSapDatabaseInstanceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSapDatabaseInstanceRequest deserializedUpdateSapDatabaseInstanceRequest + = new UpdateSapDatabaseInstanceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateSapDatabaseInstanceRequest.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSapDatabaseInstanceRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapVirtualInstanceRequest.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapVirtualInstanceRequest.java index 92708302b72b..093a96db85e4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapVirtualInstanceRequest.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapVirtualInstanceRequest.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Defines the request body for updating Virtual Instance for SAP. */ +/** + * Defines the request body for updating Virtual Instance for SAP. + */ @Fluent -public final class UpdateSapVirtualInstanceRequest { +public final class UpdateSapVirtualInstanceRequest implements JsonSerializable { /* * Gets or sets the Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * A pre-created user assigned identity with appropriate roles assigned. To learn more on identity and roles * required, visit the ACSS how-to-guide. */ - @JsonProperty(value = "identity") private UserAssignedServiceIdentity identity; - /** Creates an instance of UpdateSapVirtualInstanceRequest class. */ + /** + * Creates an instance of UpdateSapVirtualInstanceRequest class. + */ public UpdateSapVirtualInstanceRequest() { } /** * Get the tags property: Gets or sets the Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -41,7 +45,7 @@ public Map tags() { /** * Set the tags property: Gets or sets the Resource tags. - * + * * @param tags the tags value to set. * @return the UpdateSapVirtualInstanceRequest object itself. */ @@ -53,7 +57,7 @@ public UpdateSapVirtualInstanceRequest withTags(Map tags) { /** * Get the identity property: A pre-created user assigned identity with appropriate roles assigned. To learn more on * identity and roles required, visit the ACSS how-to-guide. - * + * * @return the identity value. */ public UserAssignedServiceIdentity identity() { @@ -63,7 +67,7 @@ public UserAssignedServiceIdentity identity() { /** * Set the identity property: A pre-created user assigned identity with appropriate roles assigned. To learn more on * identity and roles required, visit the ACSS how-to-guide. - * + * * @param identity the identity value to set. * @return the UpdateSapVirtualInstanceRequest object itself. */ @@ -74,7 +78,7 @@ public UpdateSapVirtualInstanceRequest withIdentity(UserAssignedServiceIdentity /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -82,4 +86,45 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateSapVirtualInstanceRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateSapVirtualInstanceRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateSapVirtualInstanceRequest. + */ + public static UpdateSapVirtualInstanceRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateSapVirtualInstanceRequest deserializedUpdateSapVirtualInstanceRequest + = new UpdateSapVirtualInstanceRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateSapVirtualInstanceRequest.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedUpdateSapVirtualInstanceRequest.identity = UserAssignedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateSapVirtualInstanceRequest; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedIdentity.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedIdentity.java index 0f8ff40295d7..5d8bce7c0333 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedIdentity.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedIdentity.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.UUID; -/** User assigned identity properties. */ +/** + * User assigned identity properties. + */ @Immutable -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * The principal ID of the assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The client ID of the assigned identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; - /** Creates an instance of UserAssignedIdentity class. */ + /** + * Creates an instance of UserAssignedIdentity class. + */ public UserAssignedIdentity() { } /** * Get the principalId property: The principal ID of the assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -38,7 +44,7 @@ public UUID principalId() { /** * Get the clientId property: The client ID of the assigned identity. - * + * * @return the clientId value. */ public UUID clientId() { @@ -47,9 +53,48 @@ public UUID clientId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedServiceIdentity.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedServiceIdentity.java index 716e9d75a864..2b30432d8c0e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedServiceIdentity.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedServiceIdentity.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -15,27 +18,26 @@ * visit the ACSS how-to-guide. */ @Fluent -public final class UserAssignedServiceIdentity { +public final class UserAssignedServiceIdentity implements JsonSerializable { /* * Type of manage identity */ - @JsonProperty(value = "type", required = true) private ManagedServiceIdentityType type; /* * User assigned identities dictionary */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of UserAssignedServiceIdentity class. */ + /** + * Creates an instance of UserAssignedServiceIdentity class. + */ public UserAssignedServiceIdentity() { } /** * Get the type property: Type of manage identity. - * + * * @return the type value. */ public ManagedServiceIdentityType type() { @@ -44,7 +46,7 @@ public ManagedServiceIdentityType type() { /** * Set the type property: Type of manage identity. - * + * * @param type the type value to set. * @return the UserAssignedServiceIdentity object itself. */ @@ -55,7 +57,7 @@ public UserAssignedServiceIdentity withType(ManagedServiceIdentityType type) { /** * Get the userAssignedIdentities property: User assigned identities dictionary. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -64,39 +66,79 @@ public Map userAssignedIdentities() { /** * Set the userAssignedIdentities property: User assigned identities dictionary. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the UserAssignedServiceIdentity object itself. */ - public UserAssignedServiceIdentity withUserAssignedIdentities( - Map userAssignedIdentities) { + public UserAssignedServiceIdentity + withUserAssignedIdentities(Map userAssignedIdentities) { this.userAssignedIdentities = userAssignedIdentities; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model UserAssignedServiceIdentity")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model UserAssignedServiceIdentity")); } if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } private static final ClientLogger LOGGER = new ClientLogger(UserAssignedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedServiceIdentity if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserAssignedServiceIdentity. + */ + public static UserAssignedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedServiceIdentity deserializedUserAssignedServiceIdentity = new UserAssignedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedUserAssignedServiceIdentity.type + = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedUserAssignedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedServiceIdentity; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineConfiguration.java index a5e80833640d..b985c90fdbc1 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineConfiguration.java @@ -6,36 +6,41 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Defines the virtual machine configuration. */ +/** + * Defines the virtual machine configuration. + */ @Fluent -public final class VirtualMachineConfiguration { +public final class VirtualMachineConfiguration implements JsonSerializable { /* * The virtual machine size. */ - @JsonProperty(value = "vmSize", required = true) private String vmSize; /* * The image reference. */ - @JsonProperty(value = "imageReference", required = true) private ImageReference imageReference; /* * The OS profile. */ - @JsonProperty(value = "osProfile", required = true) private OSProfile osProfile; - /** Creates an instance of VirtualMachineConfiguration class. */ + /** + * Creates an instance of VirtualMachineConfiguration class. + */ public VirtualMachineConfiguration() { } /** * Get the vmSize property: The virtual machine size. - * + * * @return the vmSize value. */ public String vmSize() { @@ -44,7 +49,7 @@ public String vmSize() { /** * Set the vmSize property: The virtual machine size. - * + * * @param vmSize the vmSize value to set. * @return the VirtualMachineConfiguration object itself. */ @@ -55,7 +60,7 @@ public VirtualMachineConfiguration withVmSize(String vmSize) { /** * Get the imageReference property: The image reference. - * + * * @return the imageReference value. */ public ImageReference imageReference() { @@ -64,7 +69,7 @@ public ImageReference imageReference() { /** * Set the imageReference property: The image reference. - * + * * @param imageReference the imageReference value to set. * @return the VirtualMachineConfiguration object itself. */ @@ -75,7 +80,7 @@ public VirtualMachineConfiguration withImageReference(ImageReference imageRefere /** * Get the osProfile property: The OS profile. - * + * * @return the osProfile value. */ public OSProfile osProfile() { @@ -84,7 +89,7 @@ public OSProfile osProfile() { /** * Set the osProfile property: The OS profile. - * + * * @param osProfile the osProfile value to set. * @return the VirtualMachineConfiguration object itself. */ @@ -95,33 +100,73 @@ public VirtualMachineConfiguration withOsProfile(OSProfile osProfile) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (vmSize() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property vmSize in model VirtualMachineConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vmSize in model VirtualMachineConfiguration")); } if (imageReference() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property imageReference in model VirtualMachineConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property imageReference in model VirtualMachineConfiguration")); } else { imageReference().validate(); } if (osProfile() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property osProfile in model VirtualMachineConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property osProfile in model VirtualMachineConfiguration")); } else { osProfile().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmSize", this.vmSize); + jsonWriter.writeJsonField("imageReference", this.imageReference); + jsonWriter.writeJsonField("osProfile", this.osProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualMachineConfiguration. + */ + public static VirtualMachineConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineConfiguration deserializedVirtualMachineConfiguration = new VirtualMachineConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSize".equals(fieldName)) { + deserializedVirtualMachineConfiguration.vmSize = reader.getString(); + } else if ("imageReference".equals(fieldName)) { + deserializedVirtualMachineConfiguration.imageReference = ImageReference.fromJson(reader); + } else if ("osProfile".equals(fieldName)) { + deserializedVirtualMachineConfiguration.osProfile = OSProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineResourceNames.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineResourceNames.java index dd454e38e163..a5bccaa3c8de 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineResourceNames.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineResourceNames.java @@ -5,43 +5,44 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; import java.util.Map; -/** The resource names object for virtual machine and related resources. */ +/** + * The resource names object for virtual machine and related resources. + */ @Fluent -public final class VirtualMachineResourceNames { +public final class VirtualMachineResourceNames implements JsonSerializable { /* * The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, * service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of - * HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of - * more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with - * an incrementor at the end in case of more than 1 vm per layer. + * HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more + * than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an + * incrementor at the end in case of more than 1 vm per layer. */ - @JsonProperty(value = "vmName") private String vmName; /* - * The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are - * less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + * The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less + * than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. */ - @JsonProperty(value = "hostName") private String hostname; /* * The list of network interface name objects for the selected virtual machine. Currently, only one network * interface is supported per virtual machine. */ - @JsonProperty(value = "networkInterfaces") private List networkInterfaces; /* * The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its * default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. */ - @JsonProperty(value = "osDiskName") private String osDiskName; /* @@ -49,11 +50,11 @@ public final class VirtualMachineResourceNames { * disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', * 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported */ - @JsonProperty(value = "dataDiskNames") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map> dataDiskNames; - /** Creates an instance of VirtualMachineResourceNames class. */ + /** + * Creates an instance of VirtualMachineResourceNames class. + */ public VirtualMachineResourceNames() { } @@ -63,7 +64,7 @@ public VirtualMachineResourceNames() { * is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at * the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be * {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. - * + * * @return the vmName value. */ public String vmName() { @@ -76,7 +77,7 @@ public String vmName() { * is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at * the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be * {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. - * + * * @param vmName the vmName value to set. * @return the VirtualMachineResourceNames object itself. */ @@ -89,7 +90,7 @@ public VirtualMachineResourceNames withVmName(String vmName) { * Get the hostname property: The full name for virtual-machine's host (computer name). Currently, ACSS only * supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName * will be used as host name. - * + * * @return the hostname value. */ public String hostname() { @@ -100,7 +101,7 @@ public String hostname() { * Set the hostname property: The full name for virtual-machine's host (computer name). Currently, ACSS only * supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName * will be used as host name. - * + * * @param hostname the hostname value to set. * @return the VirtualMachineResourceNames object itself. */ @@ -112,7 +113,7 @@ public VirtualMachineResourceNames withHostname(String hostname) { /** * Get the networkInterfaces property: The list of network interface name objects for the selected virtual machine. * Currently, only one network interface is supported per virtual machine. - * + * * @return the networkInterfaces value. */ public List networkInterfaces() { @@ -122,7 +123,7 @@ public List networkInterfaces() { /** * Set the networkInterfaces property: The list of network interface name objects for the selected virtual machine. * Currently, only one network interface is supported per virtual machine. - * + * * @param networkInterfaces the networkInterfaces value to set. * @return the VirtualMachineResourceNames object itself. */ @@ -135,7 +136,7 @@ public VirtualMachineResourceNames withNetworkInterfaces(List> dataDiskNames() { @@ -172,7 +173,7 @@ public Map> dataDiskNames() { * containing list of names of data disks per volume. Currently supported volumes for database layer are * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' * volume is supported. - * + * * @param dataDiskNames the dataDiskNames value to set. * @return the VirtualMachineResourceNames object itself. */ @@ -183,7 +184,7 @@ public VirtualMachineResourceNames withDataDiskNames(Map> d /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -191,4 +192,58 @@ public void validate() { networkInterfaces().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmName", this.vmName); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("osDiskName", this.osDiskName); + jsonWriter.writeMapField("dataDiskNames", this.dataDiskNames, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualMachineResourceNames from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualMachineResourceNames if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualMachineResourceNames. + */ + public static VirtualMachineResourceNames fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualMachineResourceNames deserializedVirtualMachineResourceNames = new VirtualMachineResourceNames(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmName".equals(fieldName)) { + deserializedVirtualMachineResourceNames.vmName = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedVirtualMachineResourceNames.hostname = reader.getString(); + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceResourceNames.fromJson(reader1)); + deserializedVirtualMachineResourceNames.networkInterfaces = networkInterfaces; + } else if ("osDiskName".equals(fieldName)) { + deserializedVirtualMachineResourceNames.osDiskName = reader.getString(); + } else if ("dataDiskNames".equals(fieldName)) { + Map> dataDiskNames + = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedVirtualMachineResourceNames.dataDiskNames = dataDiskNames; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualMachineResourceNames; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WindowsConfiguration.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WindowsConfiguration.java index f3b326bb9ec1..2238afe2b168 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WindowsConfiguration.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WindowsConfiguration.java @@ -5,25 +5,80 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Specifies Windows operating system settings on the virtual machine. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "osType") -@JsonTypeName("Windows") +/** + * Specifies Windows operating system settings on the virtual machine. + */ @Immutable public final class WindowsConfiguration extends OSConfiguration { - /** Creates an instance of WindowsConfiguration class. */ + /* + * The OS Type + */ + private OSType osType = OSType.WINDOWS; + + /** + * Creates an instance of WindowsConfiguration class. + */ public WindowsConfiguration() { } + /** + * Get the osType property: The OS Type. + * + * @return the osType value. + */ + @Override + public OSType osType() { + return this.osType; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WindowsConfiguration. + */ + public static WindowsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowsConfiguration deserializedWindowsConfiguration = new WindowsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("osType".equals(fieldName)) { + deserializedWindowsConfiguration.osType = OSType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowsConfiguration; + }); + } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadMonitorProvisioningState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadMonitorProvisioningState.java index e7ae99ade7ab..80157c35a06b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadMonitorProvisioningState.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadMonitorProvisioningState.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of provisioning of the SAP monitor. */ +/** + * State of provisioning of the SAP monitor. + */ public final class WorkloadMonitorProvisioningState extends ExpandableStringEnum { - /** Static value Accepted for WorkloadMonitorProvisioningState. */ + /** + * Static value Accepted for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState ACCEPTED = fromString("Accepted"); - /** Static value Creating for WorkloadMonitorProvisioningState. */ + /** + * Static value Creating for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState CREATING = fromString("Creating"); - /** Static value Updating for WorkloadMonitorProvisioningState. */ + /** + * Static value Updating for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState UPDATING = fromString("Updating"); - /** Static value Failed for WorkloadMonitorProvisioningState. */ + /** + * Static value Failed for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState FAILED = fromString("Failed"); - /** Static value Succeeded for WorkloadMonitorProvisioningState. */ + /** + * Static value Succeeded for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Deleting for WorkloadMonitorProvisioningState. */ + /** + * Static value Deleting for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState DELETING = fromString("Deleting"); - /** Static value Migrating for WorkloadMonitorProvisioningState. */ + /** + * Static value Migrating for WorkloadMonitorProvisioningState. + */ public static final WorkloadMonitorProvisioningState MIGRATING = fromString("Migrating"); /** * Creates a new instance of WorkloadMonitorProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public WorkloadMonitorProvisioningState() { /** * Creates or finds a WorkloadMonitorProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding WorkloadMonitorProvisioningState. */ - @JsonCreator public static WorkloadMonitorProvisioningState fromString(String name) { return fromString(name, WorkloadMonitorProvisioningState.class); } /** * Gets known WorkloadMonitorProvisioningState values. - * + * * @return known WorkloadMonitorProvisioningState values. */ public static Collection values() { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/package-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/package-info.java index 9597287e7c68..85eba941b480 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/package-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/package-info.java @@ -3,10 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for WorkloadsClient. Workloads client provides access to various workload - * operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - * - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Package containing the data models for WorkloadsClient. + * Workloads client provides access to various workload operations. */ package com.azure.resourcemanager.workloads.models; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/package-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/package-info.java index 44065402c77c..ea781451b175 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/package-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/package-info.java @@ -3,10 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for WorkloadsClient. Workloads client provides access to various workload - * operations.<br>Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - * - Legal - * Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) - * for legal notices applicable to Azure Center for SAP solutions. + * Package containing the classes for WorkloadsClient. + * Workloads client provides access to various workload operations. */ package com.azure.resourcemanager.workloads; diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/module-info.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/module-info.java index a3ada2c389d4..ac3c2beccdba 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/module-info.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.workloads { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.workloads; exports com.azure.resourcemanager.workloads.fluent; exports com.azure.resourcemanager.workloads.fluent.models; exports com.azure.resourcemanager.workloads.models; - - opens com.azure.resourcemanager.workloads.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.workloads.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.workloads.fluent.models to com.azure.core; + opens com.azure.resourcemanager.workloads.models to com.azure.core; +} \ No newline at end of file diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/proxy-config.json b/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/proxy-config.json new file mode 100644 index 000000000000..741aea80bfed --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.workloads.implementation.MonitorsClientImpl$MonitorsService"],["com.azure.resourcemanager.workloads.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.workloads.implementation.ProviderInstancesClientImpl$ProviderInstancesService"],["com.azure.resourcemanager.workloads.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.workloads.implementation.SapApplicationServerInstancesClientImpl$SapApplicationServerInstancesService"],["com.azure.resourcemanager.workloads.implementation.SapCentralInstancesClientImpl$SapCentralInstancesService"],["com.azure.resourcemanager.workloads.implementation.SapDatabaseInstancesClientImpl$SapDatabaseInstancesService"],["com.azure.resourcemanager.workloads.implementation.SapLandscapeMonitorsClientImpl$SapLandscapeMonitorsService"],["com.azure.resourcemanager.workloads.implementation.SapVirtualInstancesClientImpl$SapVirtualInstancesService"]] \ No newline at end of file diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/reflect-config.json b/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloads/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsCreateSamples.java index e9cd04778258..164e5d3ead81 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsCreateSamples.java @@ -9,23 +9,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Create. */ +/** + * Samples for Monitors Create. + */ public final class MonitorsCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Create.json */ /** * Sample code: Create a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .monitors() + manager.monitors() .define("mySapMonitor") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf("key", "value")) + .withTags(mapOf("key", "fakeTokenPlaceholder")) .withAppLocation("westus") .withRoutingPreference(RoutingPreference.ROUTE_ALL) .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) @@ -36,6 +39,7 @@ public static void createASAPMonitor(com.azure.resourcemanager.workloads.Workloa .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteSamples.java index 2cc50a1b37b5..cb4bd0ca1ab6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for Monitors Delete. */ +/** + * Samples for Monitors Delete. + */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Delete.json */ /** * Sample code: Deletes a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsGetByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsGetByResourceGroupSamples.java index 1fd8ef79f5fc..fd265d427e7b 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsGetByResourceGroupSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for Monitors GetByResourceGroup. */ +/** + * Samples for Monitors GetByResourceGroup. + */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_Get.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .monitors() + manager.monitors() .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListByResourceGroupSamples.java index 591fd4d50184..1987df8a6e22 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListByResourceGroupSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for Monitors ListByResourceGroup. */ +/** + * Samples for Monitors ListByResourceGroup. + */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_ListByRG.json */ /** * Sample code: List all SAP monitors in a resource group. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void listAllSAPMonitorsInAResourceGroup( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + listAllSAPMonitorsInAResourceGroup(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.monitors().listByResourceGroup("example-rg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListSamples.java index b919dfd9bfe3..0bcf3079b436 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for Monitors List. */ +/** + * Samples for Monitors List. + */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_List.json */ /** * Sample code: List all SAP monitors in a subscription. - * + * * @param manager Entry point to WorkloadsManager. */ public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsUpdateSamples.java index 66dc6792ef6a..19f15b6d658f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/MonitorsUpdateSamples.java @@ -10,50 +10,51 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Monitors Update. */ +/** + * Samples for Monitors Update. + */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_PatchTags_Delete.json */ /** * Sample code: Delete Tags field of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deleteTagsFieldOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - Monitor resource = - manager - .monitors() - .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + Monitor resource = manager.monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf()) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * monitors_PatchTags.json */ /** * Sample code: Update Tags field of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void updateTagsFieldOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - Monitor resource = - manager - .monitors() - .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("testkey", "testvalue")) + Monitor resource = manager.monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/OperationsListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/OperationsListSamples.java index 1f74cf36ff40..172d58ab2fa2 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/OperationsListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/OperationsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json */ /** * Sample code: Operations. - * + * * @param manager Entry point to WorkloadsManager. */ public static void operations(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesCreateSamples.java index 0d02da321e45..14ad85b37b31 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesCreateSamples.java @@ -13,162 +13,159 @@ import com.azure.resourcemanager.workloads.models.SslPreference; import java.util.Arrays; -/** Samples for ProviderInstances Create. */ +/** + * Samples for ProviderInstances Create. + */ public final class ProviderInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Create.json */ /** * Sample code: Create a MsSqlServer provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("sid") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withProviderSettings(new MsSqlServerProviderInstanceProperties().withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a Db2 provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createADb2ProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createADb2ProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new DB2ProviderInstanceProperties() - .withHostname("hostname") - .withDbName("dbName") - .withDbPort("dbPort") - .withDbUsername("username") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("SID") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new DB2ProviderInstanceProperties().withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Create.json */ /** * Sample code: Create a SAP monitor Hana provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslHostnameInCertificate("xyz.domain.com") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSapSid("SID")) + .withProviderSettings(new HanaDbProviderInstanceProperties().withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSapSid("SID")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a SAP monitor NetWeaver provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createASAPMonitorNetWeaverProviderWithRootCertificate( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new SapNetWeaverProviderInstanceProperties() - .withSapSid("SID") - .withSapHostname("name") - .withSapInstanceNr("00") - .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) - .withSapUsername("username") - .withSapPassword("fakeTokenPlaceholder") - .withSapPasswordUri("fakeTokenPlaceholder") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new SapNetWeaverProviderInstanceProperties().withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Create_Root_Certificate.json */ /** * Sample code: Create a MsSqlServer provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAMsSqlServerProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAMsSqlServerProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("sid") - .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .withProviderSettings(new MsSqlServerProviderInstanceProperties().withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Create.json */ /** * Sample code: Create a PrometheusHaCluster provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAPrometheusHaClusterProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAPrometheusHaClusterProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusHaClusterProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusHaClusterProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withHostname("hostname") .withSid("sid") .withClusterName("clusterName") @@ -178,22 +175,22 @@ public static void createAPrometheusHaClusterProvider( } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a PrometheusHaCluster provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAPrometheusHaClusterProviderWithRootCertificate( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusHaClusterProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusHaClusterProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withHostname("hostname") .withSid("sid") .withClusterName("clusterName") @@ -202,70 +199,69 @@ public static void createAPrometheusHaClusterProviderWithRootCertificate( } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Create.json */ /** * Sample code: Create a Db2 provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createADb2Provider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new DB2ProviderInstanceProperties() - .withHostname("hostname") - .withDbName("dbName") - .withDbPort("dbPort") - .withDbUsername("username") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSapSid("SID") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withProviderSettings(new DB2ProviderInstanceProperties().withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a OS provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createAOSProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createAOSProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusOSProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withSslPreference(SslPreference.ROOT_CERTIFICATE) .withSapSid("SID")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Create.json */ /** * Sample code: Create a OS provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createAOSProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new PrometheusOSProviderInstanceProperties() - .withPrometheusUrl("http://192.168.0.0:9090/metrics") + new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics") .withSslPreference(SslPreference.SERVER_CERTIFICATE) .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") .withSapSid("SID")) @@ -273,61 +269,59 @@ public static void createAOSProvider(com.azure.resourcemanager.workloads.Workloa } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Create.json */ /** * Sample code: Create a SAP monitor NetWeaver provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorNetWeaverProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createASAPMonitorNetWeaverProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new SapNetWeaverProviderInstanceProperties() - .withSapSid("SID") - .withSapHostname("name") - .withSapInstanceNr("00") - .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) - .withSapUsername("username") - .withSapPassword("fakeTokenPlaceholder") - .withSapPasswordUri("fakeTokenPlaceholder") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslPreference(SslPreference.SERVER_CERTIFICATE)) + .withProviderSettings(new SapNetWeaverProviderInstanceProperties().withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslPreference(SslPreference.SERVER_CERTIFICATE)) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Create_Root_Certificate.json */ /** * Sample code: Create a SAP monitor Hana provider with Root Certificate. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorHanaProviderWithRootCertificate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + createASAPMonitorHanaProviderWithRootCertificate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") - .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") - .withDbUsername("user") - .withDbPassword("fakeTokenPlaceholder") - .withDbPasswordUri("fakeTokenPlaceholder") - .withSslHostnameInCertificate("xyz.domain.com") - .withSslPreference(SslPreference.ROOT_CERTIFICATE) - .withSapSid("SID")) + .withProviderSettings(new HanaDbProviderInstanceProperties().withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) .create(); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteSamples.java index ee69c538c86a..94ec54cabcf9 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ProviderInstances Delete. */ +/** + * Samples for ProviderInstances Delete. + */ public final class ProviderInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Delete.json */ /** * Sample code: Deletes a SAP monitor provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesASAPMonitorProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .delete("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesGetSamples.java index d262a39d46ef..b12b6a03c347 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesGetSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesGetSamples.java @@ -4,93 +4,101 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ProviderInstances Get. */ +/** + * Samples for ProviderInstances Get. + */ public final class ProviderInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_Get.json */ /** * Sample code: Get properties of a SAP monitor Hana provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfASAPMonitorHanaProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusHaClusterProviderInstances_Get.json */ /** * Sample code: Get properties of a PrometheusHaCluster provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfAPrometheusHaClusterProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfAPrometheusHaClusterProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * PrometheusOSProviderInstances_Get.json */ /** * Sample code: Get properties of a OS provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfAOSProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * Db2ProviderInstances_Get.json */ /** * Sample code: Get properties of a Db2 provider. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfADb2Provider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * MsSqlServerProviderInstance_Get.json */ /** * Sample code: Get properties of a MsSqlServer provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfAMsSqlServerProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * NetWeaverProviderInstances_Get.json */ /** * Sample code: Get properties of a SAP monitor NetWeaver provider. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void getPropertiesOfASAPMonitorNetWeaverProvider( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .providerInstances() + public static void + getPropertiesOfASAPMonitorNetWeaverProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.providerInstances() .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesListSamples.java index 0abd1f21f440..a84be67188f9 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ProviderInstances List. */ +/** + * Samples for ProviderInstances List. + */ public final class ProviderInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * ProviderInstances_List.json */ /** * Sample code: List all SAP monitors providers in a subscription. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void listAllSAPMonitorsProvidersInASubscription( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + listAllSAPMonitorsProvidersInASubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.providerInstances().list("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java index f77170c0692a..e9312f93cebd 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java @@ -4,34 +4,50 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapProductType; + +/** + * Samples for ResourceProvider SapAvailabilityZoneDetails. + */ public final class ResourceProviderSapAvailabilityZoneDetailsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPAvailabilityZoneDetails_northeurope.json */ /** * Sample code: SAPAvailabilityZoneDetails_northeurope. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPAvailabilityZoneDetailsNortheurope( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapAvailabilityZoneDetailsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPAvailabilityZoneDetailsNortheurope(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapAvailabilityZoneDetailsWithResponse("centralus", + new SapAvailabilityZoneDetailsRequest().withAppLocation("northeurope") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPAvailabilityZoneDetails_eastus.json */ /** * Sample code: SAPAvailabilityZoneDetails_eastus. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPAvailabilityZoneDetailsEastus(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapAvailabilityZoneDetailsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapAvailabilityZoneDetailsWithResponse("centralus", + new SapAvailabilityZoneDetailsRequest().withAppLocation("eastus") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapDiskConfigurationsSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapDiskConfigurationsSamples.java index bb27d13d4f42..c150ceef5bcf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapDiskConfigurationsSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapDiskConfigurationsSamples.java @@ -4,33 +4,57 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ResourceProvider SapDiskConfigurations. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapProductType; + +/** + * Samples for ResourceProvider SapDiskConfigurations. + */ public final class ResourceProviderSapDiskConfigurationsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDiskConfigurations_NonProd.json */ /** * Sample code: SAPDiskConfigurations_NonProd. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDiskConfigurationsNonProd(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapDiskConfigurationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapDiskConfigurationsWithResponse("centralus", + new SapDiskConfigurationsRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDiskConfigurations_Prod.json */ /** * Sample code: SAPDiskConfigurations_Prod. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDiskConfigurationsProd(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapDiskConfigurationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapDiskConfigurationsWithResponse("centralus", + new SapDiskConfigurationsRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSizingRecommendationsSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSizingRecommendationsSamples.java index 5e1945574a62..491a8e3f7128 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSizingRecommendationsSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSizingRecommendationsSamples.java @@ -4,65 +4,117 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ResourceProvider SapSizingRecommendations. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseScaleMethod; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; + +/** + * Samples for ResourceProvider SapSizingRecommendations. + */ public final class ResourceProviderSapSizingRecommendationsSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_Distributed.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_Distributed. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPSizingRecommendationsS4HANADistributed( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPSizingRecommendationsS4HANADistributed(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(20000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_SingleServer.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_SingleServer. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPSizingRecommendationsS4HANASingleServer( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPSizingRecommendationsS4HANASingleServer(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withSaps(60000L) + .withDbMemory(2000L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_HA_AvZone.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvZone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSizingRecommendationsS4HANADistributedHAAvZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSizingRecommendations_S4HANA_HA_AvSet.json */ /** * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvSet. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPSizingRecommendationsS4HANADistributedHAAvSet( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPSizingRecommendationsS4HANADistributedHAAvSet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSizingRecommendationsWithResponse("centralus", + new SapSizingRecommendationRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSupportedSkuSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSupportedSkuSamples.java index a22efbe2f338..01278666b2bc 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSupportedSkuSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSupportedSkuSamples.java @@ -4,55 +4,102 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for ResourceProvider SapSupportedSku. */ +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +import com.azure.resourcemanager.workloads.models.SapDeploymentType; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; + +/** + * Samples for ResourceProvider SapSupportedSku. + */ public final class ResourceProviderSapSupportedSkuSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_SingleServer.json */ /** * Sample code: SAPSupportedSkus_SingleServer. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSupportedSkusSingleServer(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_Distributed.json */ /** * Sample code: SAPSupportedSkus_Distributed. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPSupportedSkusDistributed(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_DistributedHA_AvZone.json */ /** * Sample code: SAPSupportedSkus_DistributedHA_AvZone. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPSupportedSkusDistributedHAAvZone( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPSupportedSkusDistributedHAAvZone(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPSupportedSkus_DistributedHA_AvSet.json */ /** * Sample code: SAPSupportedSkus_DistributedHA_AvSet. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPSupportedSkusDistributedHAAvSet( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager.resourceProviders().sapSupportedSkuWithResponse("centralus", null, com.azure.core.util.Context.NONE); + public static void + sAPSupportedSkusDistributedHAAvSet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.resourceProviders() + .sapSupportedSkuWithResponse("centralus", + new SapSupportedSkusRequest().withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateSamples.java index c67c3d2c810d..b0c16caa2077 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateSamples.java @@ -7,20 +7,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapApplicationServerInstances Create. */ +/** + * Samples for SapApplicationServerInstances Create. + */ public final class SapApplicationServerInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Create.json */ /** * Sample code: SAPApplicationServerInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesCreate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + public static void + sAPApplicationServerInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() .define("app01") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -29,17 +32,18 @@ public static void sAPApplicationServerInstancesCreate( } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Application Server Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPApplicationServerInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + manager.sapApplicationServerInstances() .define("app01") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -47,6 +51,7 @@ public static void createSAPApplicationServerInstancesForHASystemWithAvailabilit .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteSamples.java index 88e8019ca9c2..66d42b8f6e10 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapApplicationServerInstances Delete. */ +/** + * Samples for SapApplicationServerInstances Delete. + */ public final class SapApplicationServerInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Delete.json */ /** * Sample code: SAPApplicationServerInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesDelete( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPApplicationServerInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetSamples.java index ccf1d675e140..93e2190d906a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapApplicationServerInstances Get. */ +/** + * Samples for SapApplicationServerInstances Get. + */ public final class SapApplicationServerInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Get.json */ /** * Sample code: SAPApplicationServerInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPApplicationServerInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + manager.sapApplicationServerInstances() .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListSamples.java index 9674736a96d1..d74f5fb84797 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapApplicationServerInstances List. */ +/** + * Samples for SapApplicationServerInstances List. + */ public final class SapApplicationServerInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_List.json */ /** * Sample code: SAPApplicationServerInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPApplicationServerInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceSamples.java index b1b69452f4bc..c23cd8481288 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapApplicationServerInstances StartInstance. */ +/** + * Samples for SapApplicationServerInstances StartInstance. + */ public final class SapApplicationServerInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_StartInstance.json */ /** * Sample code: Start the SAP Application Server Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheSAPApplicationServerInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() + public static void + startTheSAPApplicationServerInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() .startInstance("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceSamples.java index dd077896fdbc..bc4681b36a17 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceSamples.java @@ -6,25 +6,24 @@ import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapApplicationServerInstances StopInstance. */ +/** + * Samples for SapApplicationServerInstances StopInstance. + */ public final class SapApplicationServerInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_StopInstance.json */ /** * Sample code: Stop the SAP Application Server Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void stopTheSAPApplicationServerInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapApplicationServerInstances() - .stopInstance( - "test-rg", - "X00", - "app01", - new StopRequest().withSoftStopTimeoutSeconds(0L), + public static void + stopTheSAPApplicationServerInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapApplicationServerInstances() + .stopInstance("test-rg", "X00", "app01", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesUpdateSamples.java index 00392fec095e..8d3183b52cb7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesUpdateSamples.java @@ -8,26 +8,29 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapApplicationServerInstances Update. */ +/** + * Samples for SapApplicationServerInstances Update. + */ public final class SapApplicationServerInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPApplicationServerInstances_Update.json */ /** * Sample code: SAPApplicationServerInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPApplicationServerInstancesUpdate( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapApplicationServerInstance resource = - manager - .sapApplicationServerInstances() - .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) - .getValue(); + public static void + sAPApplicationServerInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + SapApplicationServerInstance resource = manager.sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateSamples.java index 2065995e9e14..6e34a3ca400e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateSamples.java @@ -7,20 +7,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapCentralInstances Create. */ +/** + * Samples for SapCentralInstances Create. + */ public final class SapCentralInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Central Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPCentralInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .define("centralServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -29,16 +32,17 @@ public static void createSAPCentralInstancesForHASystemWithAvailabilitySet( } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Create.json */ /** * Sample code: SAPCentralInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .define("centralServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -46,6 +50,7 @@ public static void sAPCentralInstancesCreate(com.azure.resourcemanager.workloads .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteSamples.java index f7a0f553dfc9..c0ef9151062d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapCentralInstances Delete. */ +/** + * Samples for SapCentralInstances Delete. + */ public final class SapCentralInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Delete.json */ /** * Sample code: SAPCentralInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetSamples.java index d0bc8c54c50c..0feff8f44727 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapCentralInstances Get. */ +/** + * Samples for SapCentralInstances Get. + */ public final class SapCentralInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Get.json */ /** * Sample code: SAPCentralInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + manager.sapCentralInstances() .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListSamples.java index 51265dd14a2d..3836c1212caa 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapCentralInstances List. */ +/** + * Samples for SapCentralInstances List. + */ public final class SapCentralInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_List.json */ /** * Sample code: SAPCentralInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceSamples.java index 9c407f860423..ec5cdac64637 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapCentralInstances StartInstance. */ +/** + * Samples for SapCentralInstances StartInstance. + */ public final class SapCentralInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_StartInstance.json */ /** * Sample code: Start the SAP Central Services Instance. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheSAPCentralServicesInstance( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() + public static void + startTheSAPCentralServicesInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapCentralInstances() .startInstance("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceSamples.java index f198944d42aa..63c8e5400f64 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceSamples.java @@ -6,24 +6,23 @@ import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapCentralInstances StopInstance. */ +/** + * Samples for SapCentralInstances StopInstance. + */ public final class SapCentralInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_StopInstance.json */ /** * Sample code: Stop the SAP Central Services Instance. - * + * * @param manager Entry point to WorkloadsManager. */ public static void stopTheSAPCentralServicesInstance(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapCentralInstances() - .stopInstance( - "test-rg", - "X00", - "centralServer", - new StopRequest().withSoftStopTimeoutSeconds(1200L), + manager.sapCentralInstances() + .stopInstance("test-rg", "X00", "centralServer", new StopRequest().withSoftStopTimeoutSeconds(1200L), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesUpdateSamples.java index b0d3057a112d..880eeb894ae6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesUpdateSamples.java @@ -8,25 +8,28 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapCentralInstances Update. */ +/** + * Samples for SapCentralInstances Update. + */ public final class SapCentralInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPCentralInstances_Update.json */ /** * Sample code: SAPCentralInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPCentralInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapCentralServerInstance resource = - manager - .sapCentralInstances() - .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) - .getValue(); + SapCentralServerInstance resource = manager.sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("tag1", "value1")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateSamples.java index 184cc3111fdf..dbf757cc6c13 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateSamples.java @@ -7,20 +7,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapDatabaseInstances Create. */ +/** + * Samples for SapDatabaseInstances Create. + */ public final class SapDatabaseInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Create_HA_AvSet.json */ /** * Sample code: Create SAP Database Instances for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createSAPDatabaseInstancesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .define("databaseServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -29,16 +32,17 @@ public static void createSAPDatabaseInstancesForHASystemWithAvailabilitySet( } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Create.json */ /** * Sample code: SAPDatabaseInstances_Create. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesCreate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .define("databaseServer") .withRegion("westcentralus") .withExistingSapVirtualInstance("test-rg", "X00") @@ -46,6 +50,7 @@ public static void sAPDatabaseInstancesCreate(com.azure.resourcemanager.workload .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteSamples.java index 5beb9c1e81f5..b40184920330 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapDatabaseInstances Delete. */ +/** + * Samples for SapDatabaseInstances Delete. + */ public final class SapDatabaseInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Delete.json */ /** * Sample code: SAPDatabaseInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetSamples.java index d49c786355ab..22b6015fd928 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapDatabaseInstances Get. */ +/** + * Samples for SapDatabaseInstances Get. + */ public final class SapDatabaseInstancesGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Get.json */ /** * Sample code: SAPDatabaseInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() + manager.sapDatabaseInstances() .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListSamples.java index fb6a73abab8c..39f738b20f37 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapDatabaseInstances List. */ +/** + * Samples for SapDatabaseInstances List. + */ public final class SapDatabaseInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_List.json */ /** * Sample code: SAPDatabaseInstances_List. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesList(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceSamples.java index 8a0282181e04..a6c1200d6df6 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapDatabaseInstances StartInstance. */ +/** + * Samples for SapDatabaseInstances StartInstance. + */ public final class SapDatabaseInstancesStartInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_StartInstance.json */ /** * Sample code: Start the database instance of the SAP system. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void startTheDatabaseInstanceOfTheSAPSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + startTheDatabaseInstanceOfTheSAPSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapDatabaseInstances().startInstance("test-rg", "X00", "db0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceSamples.java index 729e28939213..fdb70029d940 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceSamples.java @@ -6,25 +6,24 @@ import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapDatabaseInstances StopInstance. */ +/** + * Samples for SapDatabaseInstances StopInstance. + */ public final class SapDatabaseInstancesStopInstanceSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_StopInstance.json */ /** * Sample code: Stop the database instance of the SAP system. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void stopTheDatabaseInstanceOfTheSAPSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapDatabaseInstances() - .stopInstance( - "test-rg", - "X00", - "db0", - new StopRequest().withSoftStopTimeoutSeconds(0L), + public static void + stopTheDatabaseInstanceOfTheSAPSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapDatabaseInstances() + .stopInstance("test-rg", "X00", "db0", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesUpdateSamples.java index d196fe69eb6f..4132e149644d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesUpdateSamples.java @@ -8,25 +8,28 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapDatabaseInstances Update. */ +/** + * Samples for SapDatabaseInstances Update. + */ public final class SapDatabaseInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPDatabaseInstances_Update.json */ /** * Sample code: SAPDatabaseInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPDatabaseInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapDatabaseInstance resource = - manager - .sapDatabaseInstances() - .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("key1", "value1")).apply(); + SapDatabaseInstance resource = manager.sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorCreateSamples.java index a91e3e60a994..0b1df760cf36 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorCreateSamples.java @@ -10,46 +10,35 @@ import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; import java.util.Arrays; -/** Samples for SapLandscapeMonitor Create. */ +/** + * Samples for SapLandscapeMonitor Create. + */ public final class SapLandscapeMonitorCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Create.json */ /** * Sample code: Create for SAP Landscape monitor Dashboard. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createForSAPLandscapeMonitorDashboard( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() - .createWithResponse( - "myResourceGroup", - "mySapMonitor", + public static void + createForSAPLandscapeMonitorDashboard(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapLandscapeMonitors() + .createWithResponse("myResourceGroup", "mySapMonitor", new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("Prod") - .withTopSid(Arrays.asList("SID1", "SID2")))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("ERP1") - .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withGrouping(new SapLandscapeMonitorPropertiesGrouping() + .withLandscape(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("Instance Availability") - .withGreen(90.0F) - .withYellow(75.0F) - .withRed(50.0F))), + Arrays.asList(new SapLandscapeMonitorMetricThresholds().withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorDeleteSamples.java index 186043e55f5c..618ccd04dc1d 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorDeleteSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapLandscapeMonitor Delete. */ +/** + * Samples for SapLandscapeMonitor Delete. + */ public final class SapLandscapeMonitorDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Delete.json */ /** * Sample code: Deletes SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void deletesSAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .deleteByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorGetSamples.java index 54a559ac54f4..d1b5a775902e 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorGetSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorGetSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapLandscapeMonitor Get. */ +/** + * Samples for SapLandscapeMonitor Get. + */ public final class SapLandscapeMonitorGetSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Get.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .getWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListSamples.java index e9e20d816b03..434edc42de5f 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapLandscapeMonitor List. */ +/** + * Samples for SapLandscapeMonitor List. + */ public final class SapLandscapeMonitorListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_List.json */ /** * Sample code: Get properties of a SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() + manager.sapLandscapeMonitors() .listWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorUpdateSamples.java index ad792bc40b7b..707b76856fbf 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorUpdateSamples.java @@ -10,45 +10,34 @@ import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; import java.util.Arrays; -/** Samples for SapLandscapeMonitor Update. */ +/** + * Samples for SapLandscapeMonitor Update. + */ public final class SapLandscapeMonitorUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ + * SapLandscapeMonitor_Update.json */ /** * Sample code: Update SAP monitor. - * + * * @param manager Entry point to WorkloadsManager. */ public static void updateSAPMonitor(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapLandscapeMonitors() - .updateWithResponse( - "myResourceGroup", - "mySapMonitor", + manager.sapLandscapeMonitors() + .updateWithResponse("myResourceGroup", "mySapMonitor", new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("Prod") - .withTopSid(Arrays.asList("SID1", "SID2")))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("ERP1") - .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withGrouping(new SapLandscapeMonitorPropertiesGrouping() + .withLandscape(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication(Arrays.asList(new SapLandscapeMonitorSidMapping().withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("Instance Availability") - .withGreen(90.0F) - .withYellow(75.0F) - .withRed(50.0F))), + Arrays.asList(new SapLandscapeMonitorMetricThresholds().withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateSamples.java index a2d966a4a21e..a73f0c88f7e4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateSamples.java @@ -48,2845 +48,1819 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapVirtualInstances Create. */ +/** + * Samples for SapVirtualInstances Create. + */ public final class SapVirtualInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Install_Distributed.json */ /** * Sample code: Install SAP Software on Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void installSAPSoftwareOnDistributedSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + installSAPSoftwareOnDistributedSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("{{resourcegrp}}") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("8.2") - .withVersion("8.2.2021091201")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withSoftwareConfiguration( - new SapInstallWithoutOSConfigSoftwareConfiguration() - .withBomUrl( - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") - .withSapBitsStorageAccountId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") - .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer(new DatabaseConfiguration().withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration(new SapInstallWithoutOSConfigSoftwareConfiguration().withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf("created by", "azureuser")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_HA_AvZone.json */ /** * Sample code: Create Infrastructure only for HA System with Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureOnlyForHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_Distributed.json */ /** * Sample code: Create Infrastructure with OS configuration for Distributed System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForDistributedSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_SingleServer.json */ /** * Sample code: Detect SAP Software Installation on a Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnASingleServerSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Set * (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_HA_AvSet.json */ /** * Sample code: Create Infrastructure only for HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureOnlyForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(5L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(5L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_HA_AvZone.json */ /** * Sample code: Detect SAP Software Installation on an HA System with Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_SingleServer.json */ /** * Sample code: Create Infrastructure only for Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createInfrastructureOnlyForSingleServerSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + createInfrastructureOnlyForSingleServerSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData("fakeTokenPlaceholder"))))))))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_CreateTransport.json */ /** * Sample code: Create Infrastructure with a new SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithANewSAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration( - new CreateAndMountFileShareConfiguration() - .withResourceGroup("rgName") - .withStorageAccountName("storageName")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration().withTransportFileShareConfiguration( + new CreateAndMountFileShareConfiguration().withResourceGroup("rgName") + .withStorageAccountName("storageName")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Discover.json */ /** * Sample code: Register existing SAP system as Virtual Instance for SAP solutions. - * + * * @param manager Entry point to WorkloadsManager. */ public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutions( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("northeurope") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DiscoveryConfiguration() - .withCentralServerVmId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withConfiguration(new DiscoveryConfiguration().withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration().withDisablePasswordAuthentication( + true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer(new CentralServerFullResourceNames().withVirtualMachines( + Arrays.asList(new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("ascsdisk0")))))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("ascsdisk0")))))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0"))))) - .withAvailabilitySetName("appAvSet")) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvm") - .withHostname("dbhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbnic"))) - .withOsDiskName("dbosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadata0", "hanadata1"), - "hanaLog", - Arrays.asList("hanalog0", "hanalog1", "hanalog2"), - "hanaShared", - Arrays.asList("hanashared0", "hanashared1"), - "usrSap", - Arrays.asList("usrsap0")))))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays + .asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer(new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList(new VirtualMachineResourceNames().withVmName("dbvm") + .withHostname("dbhostName") + .withNetworkInterfaces(Arrays + .asList(new NetworkInterfaceResourceNames().withNetworkInterfaceName("dbnic"))) + .withOsDiskName("dbosdisk") + .withDataDiskNames(mapOf("hanaData", Arrays.asList("hanadata0", "hanadata1"), + "hanaLog", Arrays.asList("hanalog0", "hanalog1", "hanalog2"), "hanaShared", + Arrays.asList("hanashared0", "hanashared1"), "usrSap", + Arrays.asList("usrsap0")))))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA system with * Availability Zone. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) + new CentralServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames().withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames(Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames(Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0")))))) .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk"), - new VirtualMachineResourceNames() - .withVmName("ersvm") - .withHostname("ershostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ersnic"))) - .withOsDiskName("ersosdisk"))) - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("ascslb") - .withFrontendIpConfigurationNames( - Arrays.asList("ascsip0", "ersip0")) - .withBackendPoolNames(Arrays.asList("ascsBackendPool")) - .withHealthProbeNames( - Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0")))))) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvmpr") - .withHostname("dbprhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbprnic"))) - .withOsDiskName("dbprosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatapr0", "hanadatapr1"), - "hanaLog", - Arrays - .asList( - "hanalogpr0", "hanalogpr1", "hanalogpr2"), - "hanaShared", - Arrays.asList("hanasharedpr0", "hanasharedpr1"), - "usrSap", - Arrays.asList("usrsappr0"))), - new VirtualMachineResourceNames() - .withVmName("dbvmsr") - .withHostname("dbsrhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbsrnic"))) - .withOsDiskName("dbsrosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatasr0", "hanadatasr1"), - "hanaLog", - Arrays - .asList( - "hanalogsr0", "hanalogsr1", "hanalogsr2"), - "hanaShared", - Arrays.asList("hanasharedsr0", "hanasharedsr1"), - "usrSap", - Arrays.asList("usrsapsr0"))))) - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("dblb") - .withFrontendIpConfigurationNames(Arrays.asList("dbip")) - .withBackendPoolNames(Arrays.asList("dbBackendPool")) - .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames(mapOf( + "hanaData", Arrays.asList("hanadatapr0", "hanadatapr1"), "hanaLog", + Arrays.asList("hanalogpr0", "hanalogpr1", "hanalogpr2"), "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames().withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf("hanaData", Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", Arrays.asList("hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", Arrays.asList("usrsapsr0"))))) + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_MountTransport.json */ /** * Sample code: Create Infrastructure with an existing SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithAnExistingSAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration( - new MountFileShareConfiguration() - .withId( - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") - .withPrivateEndpointId( - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration() + .withTransportFileShareConfiguration(new MountFileShareConfiguration().withId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") + .withPrivateEndpointId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json */ /** * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA System with * Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) + new CentralServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames().withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces(Arrays.asList( + new NetworkInterfaceResourceNames().withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withAvailabilitySetName("csAvSet") + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames(Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames(Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) + new ApplicationServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames().withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames(mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) - .withCustomResourceNames( - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ascsvm") - .withHostname("ascshostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ascsnic"))) - .withOsDiskName("ascsosdisk"), - new VirtualMachineResourceNames() - .withVmName("ersvm") - .withHostname("ershostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("ersnic"))) - .withOsDiskName("ersosdisk"))) - .withAvailabilitySetName("csAvSet") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("ascslb") - .withFrontendIpConfigurationNames( - Arrays.asList("ascsip0", "ersip0")) - .withBackendPoolNames(Arrays.asList("ascsBackendPool")) - .withHealthProbeNames( - Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("appvm0") - .withHostname("apphostName0") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic0"))) - .withOsDiskName("app0osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app0disk0"))), - new VirtualMachineResourceNames() - .withVmName("appvm1") - .withHostname("apphostName1") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("appnic1"))) - .withOsDiskName("app1osdisk") - .withDataDiskNames( - mapOf("default", Arrays.asList("app1disk0"))))) - .withAvailabilitySetName("appAvSet")) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("dbvmpr") - .withHostname("dbprhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbprnic"))) - .withOsDiskName("dbprosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatapr0", "hanadatapr1"), - "hanaLog", - Arrays - .asList( - "hanalogpr0", "hanalogpr1", "hanalogpr2"), - "hanaShared", - Arrays.asList("hanasharedpr0", "hanasharedpr1"), - "usrSap", - Arrays.asList("usrsappr0"))), - new VirtualMachineResourceNames() - .withVmName("dbvmsr") - .withHostname("dbsrhostName") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames() - .withNetworkInterfaceName("dbsrnic"))) - .withOsDiskName("dbsrosdisk") - .withDataDiskNames( - mapOf( - "hanaData", - Arrays.asList("hanadatasr0", "hanadatasr1"), - "hanaLog", - Arrays - .asList( - "hanalogsr0", "hanalogsr1", "hanalogsr2"), - "hanaShared", - Arrays.asList("hanasharedsr0", "hanasharedsr1"), - "usrSap", - Arrays.asList("usrsapsr0"))))) - .withAvailabilitySetName("dbAvSet") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("dblb") - .withFrontendIpConfigurationNames(Arrays.asList("dbip")) - .withBackendPoolNames(Arrays.asList("dbBackendPool")) - .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("storageacc") - .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + new DatabaseServerFullResourceNames() + .withVirtualMachines(Arrays.asList( + new VirtualMachineResourceNames().withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames(mapOf( + "hanaData", Arrays.asList("hanadatapr0", "hanadatapr1"), "hanaLog", + Arrays.asList("hanalogpr0", "hanalogpr1", "hanalogpr2"), "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames().withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces(Arrays.asList(new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf("hanaData", Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", Arrays.asList("hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", Arrays.asList("usrsapsr0"))))) + .withAvailabilitySetName("dbAvSet") + .withLoadBalancer(new LoadBalancerResourceNames().withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames().withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json */ /** * Sample code: Create Infrastructure with OS configuration for HA System with Availability Set (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_Distributed.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for Distributed System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_Distributed.json */ /** * Sample code: Detect SAP Software Installation on a Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnADistributedSystem( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("{{resourcegrp}}") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E4ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureuser") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer(new DatabaseConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("azureuser") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf("created by", "azureuser")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_DetectInstallation_HA_AvSet.json */ /** * Sample code: Detect SAP Software Installation on an HA System with Availability Set. - * + * * @param manager Entry point to WorkloadsManager. */ public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP-HA") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) - .withSoftwareConfiguration( - new ExternalInstallationSoftwareConfiguration() - .withCentralServerVmId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withSoftwareConfiguration(new ExternalInstallationSoftwareConfiguration().withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Install_SingleServer.json */ /** * Sample code: Install SAP Software on Single Server System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void installSAPSoftwareOnSingleServerSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + installSAPSoftwareOnSingleServerSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("eastus2") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("test-rg") - .withSubnetId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("SUSE") - .withOffer("SLES-SAP") - .withSku("12-sp4-gen2") - .withVersion("2022.02.01")) - .withOsProfile( - new OSProfile() - .withAdminUsername("azureappadmin") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withSoftwareConfiguration( - new SapInstallWithoutOSConfigSoftwareConfiguration() - .withBomUrl( - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") - .withSapBitsStorageAccountId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") - .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("test-rg") + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("SUSE") + .withOffer("SLES-SAP") + .withSku("12-sp4-gen2") + .withVersion("2022.02.01")) + .withOsProfile(new OSProfile().withAdminUsername("azureappadmin") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration(new SapInstallWithoutOSConfigSoftwareConfiguration().withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed.json */ /** * Sample code: Create Infrastructure only for Distributed System. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void createInfrastructureOnlyForDistributedSystem( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + public static void + createInfrastructureOnlyForDistributedSystem(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSsh( - new SshConfiguration() - .withPublicKeys( - Arrays - .asList( - new SshPublicKey() - .withKeyData( - "fakeTokenPlaceholder"))))))) - .withInstanceCount(1L)))) + .withConfiguration(new DeploymentConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSsh(new SshConfiguration().withPublicKeys( + Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json */ /** * Sample code: Register existing SAP system as Virtual Instance for SAP solutions with optional customizations. - * + * * @param manager Entry point to WorkloadsManager. */ public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("northeurope") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DiscoveryConfiguration() - .withCentralServerVmId( - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") - .withManagedRgStorageAccountName("q20saacssgrs")) + .withConfiguration(new DiscoveryConfiguration().withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") + .withManagedRgStorageAccountName("q20saacssgrs")) .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_Distributed_SkipTransport.json */ /** * Sample code: Create Infrastructure without a SAP Transport Directory Fileshare. - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithoutASAPTransportDirectoryFileshare( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(1L)) - .withStorageConfiguration( - new StorageConfiguration() - .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration(new StorageConfiguration() + .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_SingleServer.json */ /** * Sample code: Create Infrastructure with OS configuration for Single Server System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForSingleServerSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder")))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json */ /** * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Zone * (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L) - .withDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json */ /** * Sample code: Create Infrastructure with OS configuration for HA System with Availability Zone (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new ThreeTierConfiguration() - .withAppResourceGroup("X00-RG") - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E16ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(6L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_M32ts") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withInstanceCount(2L)) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new ThreeTierConfiguration().withAppResourceGroup("X00-RG") + .withCentralServer(new CentralServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer(new ApplicationServerConfiguration().withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer(new DatabaseConfiguration().withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_M32ts") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig(new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Create_DiskDetails_SingleServer.json */ /** * Sample code: Create Infrastructure with Disk and OS configurations for Single Server System (Recommended). - * + * * @param manager Entry point to WorkloadsManager. */ public static void createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended( com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .define("X00") .withRegion("westcentralus") .withExistingResourceGroup("test-rg") .withEnvironment(SapEnvironmentType.NON_PROD) .withSapProduct(SapProductType.S4HANA) - .withConfiguration( - new DeploymentWithOSConfiguration() - .withAppLocation("eastus") - .withInfrastructureConfiguration( - new SingleServerConfiguration() - .withAppResourceGroup("X00-RG") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) - .withDatabaseType(SapDatabaseType.HANA) - .withSubnetId( - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") - .withVirtualMachineConfiguration( - new VirtualMachineConfiguration() - .withVmSize("Standard_E32ds_v4") - .withImageReference( - new ImageReference() - .withPublisher("RedHat") - .withOffer("RHEL-SAP") - .withSku("84sapha-gen2") - .withVersion("latest")) - .withOsProfile( - new OSProfile() - .withAdminUsername("{your-username}") - .withOsConfiguration( - new LinuxConfiguration() - .withDisablePasswordAuthentication(true) - .withSshKeyPair( - new SshKeyPair() - .withPublicKey("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder"))))) - .withDbDiskConfiguration( - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "backup", - new DiskVolumeConfiguration() - .withCount(2L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "hana/data", - new DiskVolumeConfiguration() - .withCount(4L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/log", - new DiskVolumeConfiguration() - .withCount(3L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "hana/shared", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(256L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "os", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(64L) - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), - "usr/sap", - new DiskVolumeConfiguration() - .withCount(1L) - .withSizeGB(128L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) - .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withConfiguration(new DeploymentWithOSConfiguration().withAppLocation("eastus") + .withInfrastructureConfiguration(new SingleServerConfiguration().withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("Standard_E32ds_v4") + .withImageReference(new ImageReference().withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile(new OSProfile().withAdminUsername("{your-username}") + .withOsConfiguration(new LinuxConfiguration().withDisablePasswordAuthentication(true) + .withSshKeyPair(new SshKeyPair().withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withDbDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf("backup", + new DiskVolumeConfiguration().withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration().withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration().withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration().withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) .withTags(mapOf()) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteSamples.java index cf48c7038eab..64ad0d640f6a 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapVirtualInstances Delete. */ +/** + * Samples for SapVirtualInstances Delete. + */ public final class SapVirtualInstancesDeleteSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Delete.json */ /** * Sample code: SAPVirtualInstances_Delete. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesDelete(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupSamples.java index 43f596d4d64f..0ec508a03f71 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapVirtualInstances GetByResourceGroup. */ +/** + * Samples for SapVirtualInstances GetByResourceGroup. + */ public final class SapVirtualInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Get.json */ /** * Sample code: SAPVirtualInstances_Get. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesGet(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupSamples.java index 057f35e202ae..272e29cb2c49 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapVirtualInstances ListByResourceGroup. */ +/** + * Samples for SapVirtualInstances ListByResourceGroup. + */ public final class SapVirtualInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_ListByResourceGroup.json */ /** * Sample code: SAPVirtualInstances_ListByResourceGroup. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPVirtualInstancesListByResourceGroup( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPVirtualInstancesListByResourceGroup(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapVirtualInstances().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListSamples.java index 889ada79996b..c9ffa8f2d36c 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapVirtualInstances List. */ +/** + * Samples for SapVirtualInstances List. + */ public final class SapVirtualInstancesListSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_ListBySubscription.json */ /** * Sample code: SAPVirtualInstances_ListBySubscription. - * + * * @param manager Entry point to WorkloadsManager. */ - public static void sAPVirtualInstancesListBySubscription( - com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void + sAPVirtualInstancesListBySubscription(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager.sapVirtualInstances().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartSamples.java index dba1a135839c..3f68e4b1ce49 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.workloads.generated; -/** Samples for SapVirtualInstances Start. */ +/** + * Samples for SapVirtualInstances Start. + */ public final class SapVirtualInstancesStartSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Start.json */ /** * Sample code: SAPVirtualInstances_Start. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesStart(com.azure.resourcemanager.workloads.WorkloadsManager manager) { diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopSamples.java index b56ebd164ac7..feb7c80719b4 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopSamples.java @@ -6,19 +6,22 @@ import com.azure.resourcemanager.workloads.models.StopRequest; -/** Samples for SapVirtualInstances Stop. */ +/** + * Samples for SapVirtualInstances Stop. + */ public final class SapVirtualInstancesStopSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Stop.json */ /** * Sample code: SAPVirtualInstances_Stop. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesStop(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - manager - .sapVirtualInstances() + manager.sapVirtualInstances() .stop("test-rg", "X00", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); } } diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesUpdateSamples.java index 27eb7907df87..4e5ecd7c6154 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesUpdateSamples.java +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesUpdateSamples.java @@ -10,29 +10,31 @@ import java.util.HashMap; import java.util.Map; -/** Samples for SapVirtualInstances Update. */ +/** + * Samples for SapVirtualInstances Update. + */ public final class SapVirtualInstancesUpdateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json + * x-ms-original-file: + * specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/ + * SAPVirtualInstances_Update.json */ /** * Sample code: SAPVirtualInstances_Update. - * + * * @param manager Entry point to WorkloadsManager. */ public static void sAPVirtualInstancesUpdate(com.azure.resourcemanager.workloads.WorkloadsManager manager) { - SapVirtualInstance resource = - manager - .sapVirtualInstances() - .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("key1", "svi1")) + SapVirtualInstance resource = manager.sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerFullResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerFullResourceNamesTests.java deleted file mode 100644 index 1c8bf5290406..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerFullResourceNamesTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ApplicationServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationServerFullResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationServerFullResourceNames model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"vmName\":\"wzrmuh\",\"hostName\":\"fcqdpsq\",\"networkInterfaces\":[],\"osDiskName\":\"svuo\",\"dataDiskNames\":{\"erqwkyhkobopg\":[\"celve\",\"rypqlmfeo\"]}},{\"vmName\":\"dkow\",\"hostName\":\"bqpc\",\"networkInterfaces\":[],\"osDiskName\":\"wccsnjvcdwxlpqek\",\"dataDiskNames\":{\"fq\":[\"htjsying\"],\"birryuzhl\":[\"mtdh\",\"mdvy\",\"gikdgsz\",\"w\"],\"nrvgoupmfiibfgg\":[\"joqrvqqaatj\"]}},{\"vmName\":\"ool\",\"hostName\":\"wxkvtkkgll\",\"networkInterfaces\":[],\"osDiskName\":\"gvjayvblmh\",\"dataDiskNames\":{\"nhlmctlpdng\":[\"hbxvvyhgsopbyrqu\",\"egxuvwzf\"],\"rrvqa\":[\"vgbmhr\",\"xkw\",\"yijejvegrhbpnaix\",\"xccbdreaxhcex\"],\"s\":[\"kghtpwijnh\",\"jsvfycxzbfvoowv\",\"vmtgjqppy\"],\"krrjrea\":[\"on\",\"myhgfipnsxkmc\",\"a\"]}},{\"vmName\":\"tsgumhj\",\"hostName\":\"ikkx\",\"networkInterfaces\":[],\"osDiskName\":\"lbqpvuzlmvfelf\",\"dataDiskNames\":{\"saz\":[\"lcrpw\",\"xeznoi\",\"brnjwmw\",\"pn\"],\"dm\":[\"joqkagfhsxt\",\"augzxnfaazpxdtn\"],\"ou\":[\"j\",\"lwuenvrkp\"],\"qttezlwfffiakpjp\":[\"bre\",\"qaaysjkixqt\"]}}],\"availabilitySetName\":\"m\"}") - .toObject(ApplicationServerFullResourceNames.class); - Assertions.assertEquals("wzrmuh", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("fcqdpsq", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("svuo", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("celve", model.virtualMachines().get(0).dataDiskNames().get("erqwkyhkobopg").get(0)); - Assertions.assertEquals("m", model.availabilitySetName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationServerFullResourceNames model = - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("wzrmuh") - .withHostname("fcqdpsq") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("svuo") - .withDataDiskNames(mapOf("erqwkyhkobopg", Arrays.asList("celve", "rypqlmfeo"))), - new VirtualMachineResourceNames() - .withVmName("dkow") - .withHostname("bqpc") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("wccsnjvcdwxlpqek") - .withDataDiskNames( - mapOf( - "fq", - Arrays.asList("htjsying"), - "birryuzhl", - Arrays.asList("mtdh", "mdvy", "gikdgsz", "w"), - "nrvgoupmfiibfgg", - Arrays.asList("joqrvqqaatj"))), - new VirtualMachineResourceNames() - .withVmName("ool") - .withHostname("wxkvtkkgll") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("gvjayvblmh") - .withDataDiskNames( - mapOf( - "nhlmctlpdng", - Arrays.asList("hbxvvyhgsopbyrqu", "egxuvwzf"), - "rrvqa", - Arrays.asList("vgbmhr", "xkw", "yijejvegrhbpnaix", "xccbdreaxhcex"), - "s", - Arrays.asList("kghtpwijnh", "jsvfycxzbfvoowv", "vmtgjqppy"), - "krrjrea", - Arrays.asList("on", "myhgfipnsxkmc", "a"))), - new VirtualMachineResourceNames() - .withVmName("tsgumhj") - .withHostname("ikkx") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("lbqpvuzlmvfelf") - .withDataDiskNames( - mapOf( - "saz", - Arrays.asList("lcrpw", "xeznoi", "brnjwmw", "pn"), - "dm", - Arrays.asList("joqkagfhsxt", "augzxnfaazpxdtn"), - "ou", - Arrays.asList("j", "lwuenvrkp"), - "qttezlwfffiakpjp", - Arrays.asList("bre", "qaaysjkixqt"))))) - .withAvailabilitySetName("m"); - model = BinaryData.fromObject(model).toObject(ApplicationServerFullResourceNames.class); - Assertions.assertEquals("wzrmuh", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("fcqdpsq", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("svuo", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("celve", model.virtualMachines().get(0).dataDiskNames().get("erqwkyhkobopg").get(0)); - Assertions.assertEquals("m", model.availabilitySetName()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerVmDetailsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerVmDetailsTests.java deleted file mode 100644 index a2dc78bdff3d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ApplicationServerVmDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ApplicationServerVmDetails; - -public final class ApplicationServerVmDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationServerVmDetails model = - BinaryData - .fromString( - "{\"type\":\"Active\",\"virtualMachineId\":\"sgwbnbbeld\",\"storageDetails\":[{\"id\":\"baliourqhakauha\"}]}") - .toObject(ApplicationServerVmDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationServerVmDetails model = new ApplicationServerVmDetails(); - model = BinaryData.fromObject(model).toObject(ApplicationServerVmDetails.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerFullResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerFullResourceNamesTests.java deleted file mode 100644 index ee657f126615..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerFullResourceNamesTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.CentralServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.LoadBalancerResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CentralServerFullResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CentralServerFullResourceNames model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"vmName\":\"rfzeey\",\"hostName\":\"izikayuhq\",\"networkInterfaces\":[],\"osDiskName\":\"sybbqwr\",\"dataDiskNames\":{\"owqkdwytisi\":[\"gmfpgvmp\",\"paslthaqfxssmwu\",\"wbdsr\",\"zpdrhneu\"],\"iavrm\":[\"rcgp\",\"kpzi\",\"ejzanlfz\"],\"pj\":[\"onok\",\"xrjqcirgzpfrlazs\",\"rnwoiindfp\"]}}],\"availabilitySetName\":\"wbtlhflsjcdh\",\"loadBalancer\":{\"loadBalancerName\":\"jvfbgofelja\",\"frontendIpConfigurationNames\":[\"mqhldvrii\",\"ojnal\",\"hfkvtvsexsowuel\"],\"backendPoolNames\":[\"hahhxvrhmzkwpj\",\"wws\",\"ughftqsx\",\"qxujxukndxd\"],\"healthProbeNames\":[\"jguufzdm\",\"yqtfihwh\",\"otzi\",\"gamv\"]}}") - .toObject(CentralServerFullResourceNames.class); - Assertions.assertEquals("rfzeey", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("izikayuhq", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("sybbqwr", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("gmfpgvmp", model.virtualMachines().get(0).dataDiskNames().get("owqkdwytisi").get(0)); - Assertions.assertEquals("wbtlhflsjcdh", model.availabilitySetName()); - Assertions.assertEquals("jvfbgofelja", model.loadBalancer().loadBalancerName()); - Assertions.assertEquals("mqhldvrii", model.loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("hahhxvrhmzkwpj", model.loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("jguufzdm", model.loadBalancer().healthProbeNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CentralServerFullResourceNames model = - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("rfzeey") - .withHostname("izikayuhq") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("sybbqwr") - .withDataDiskNames( - mapOf( - "owqkdwytisi", - Arrays.asList("gmfpgvmp", "paslthaqfxssmwu", "wbdsr", "zpdrhneu"), - "iavrm", - Arrays.asList("rcgp", "kpzi", "ejzanlfz"), - "pj", - Arrays.asList("onok", "xrjqcirgzpfrlazs", "rnwoiindfp"))))) - .withAvailabilitySetName("wbtlhflsjcdh") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("jvfbgofelja") - .withFrontendIpConfigurationNames(Arrays.asList("mqhldvrii", "ojnal", "hfkvtvsexsowuel")) - .withBackendPoolNames(Arrays.asList("hahhxvrhmzkwpj", "wws", "ughftqsx", "qxujxukndxd")) - .withHealthProbeNames(Arrays.asList("jguufzdm", "yqtfihwh", "otzi", "gamv"))); - model = BinaryData.fromObject(model).toObject(CentralServerFullResourceNames.class); - Assertions.assertEquals("rfzeey", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("izikayuhq", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("sybbqwr", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("gmfpgvmp", model.virtualMachines().get(0).dataDiskNames().get("owqkdwytisi").get(0)); - Assertions.assertEquals("wbtlhflsjcdh", model.availabilitySetName()); - Assertions.assertEquals("jvfbgofelja", model.loadBalancer().loadBalancerName()); - Assertions.assertEquals("mqhldvrii", model.loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("hahhxvrhmzkwpj", model.loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("jguufzdm", model.loadBalancer().healthProbeNames().get(0)); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerVmDetailsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerVmDetailsTests.java deleted file mode 100644 index 3eb84c4e140e..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CentralServerVmDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; - -public final class CentralServerVmDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CentralServerVmDetails model = - BinaryData - .fromString( - "{\"type\":\"ASCS\",\"virtualMachineId\":\"wqvhkhixuigdt\",\"storageDetails\":[{\"id\":\"bjoghmewuamau\"}]}") - .toObject(CentralServerVmDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CentralServerVmDetails model = new CentralServerVmDetails(); - model = BinaryData.fromObject(model).toObject(CentralServerVmDetails.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CreateAndMountFileShareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CreateAndMountFileShareConfigurationTests.java deleted file mode 100644 index 3f8f7f73f4d3..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/CreateAndMountFileShareConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.CreateAndMountFileShareConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class CreateAndMountFileShareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CreateAndMountFileShareConfiguration model = - BinaryData - .fromString( - "{\"configurationType\":\"CreateAndMount\",\"resourceGroup\":\"ebwnujhe\",\"storageAccountName\":\"sbvdkcrodtjinfw\"}") - .toObject(CreateAndMountFileShareConfiguration.class); - Assertions.assertEquals("ebwnujhe", model.resourceGroup()); - Assertions.assertEquals("sbvdkcrodtjinfw", model.storageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CreateAndMountFileShareConfiguration model = - new CreateAndMountFileShareConfiguration() - .withResourceGroup("ebwnujhe") - .withStorageAccountName("sbvdkcrodtjinfw"); - model = BinaryData.fromObject(model).toObject(CreateAndMountFileShareConfiguration.class); - Assertions.assertEquals("ebwnujhe", model.resourceGroup()); - Assertions.assertEquals("sbvdkcrodtjinfw", model.storageAccountName()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseServerFullResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseServerFullResourceNamesTests.java deleted file mode 100644 index a9af239e5369..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseServerFullResourceNamesTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DatabaseServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.LoadBalancerResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseServerFullResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseServerFullResourceNames model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"vmName\":\"tmmjihyeozph\",\"hostName\":\"auyqncygupkv\",\"networkInterfaces\":[],\"osDiskName\":\"scw\",\"dataDiskNames\":{\"ypelmcu\":[\"evzhfsto\",\"xhojuj\"]}}],\"availabilitySetName\":\"ixbjx\",\"loadBalancer\":{\"loadBalancerName\":\"n\",\"frontendIpConfigurationNames\":[\"coolsttpkiwkkb\"],\"backendPoolNames\":[\"rywvtylbfpn\",\"urdoi\",\"iithtywu\",\"xcbihw\"],\"healthProbeNames\":[\"fdntwjchrdgoih\"]}}") - .toObject(DatabaseServerFullResourceNames.class); - Assertions.assertEquals("tmmjihyeozph", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("auyqncygupkv", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("scw", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("evzhfsto", model.virtualMachines().get(0).dataDiskNames().get("ypelmcu").get(0)); - Assertions.assertEquals("ixbjx", model.availabilitySetName()); - Assertions.assertEquals("n", model.loadBalancer().loadBalancerName()); - Assertions.assertEquals("coolsttpkiwkkb", model.loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("rywvtylbfpn", model.loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("fdntwjchrdgoih", model.loadBalancer().healthProbeNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseServerFullResourceNames model = - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("tmmjihyeozph") - .withHostname("auyqncygupkv") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("scw") - .withDataDiskNames(mapOf("ypelmcu", Arrays.asList("evzhfsto", "xhojuj"))))) - .withAvailabilitySetName("ixbjx") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("n") - .withFrontendIpConfigurationNames(Arrays.asList("coolsttpkiwkkb")) - .withBackendPoolNames(Arrays.asList("rywvtylbfpn", "urdoi", "iithtywu", "xcbihw")) - .withHealthProbeNames(Arrays.asList("fdntwjchrdgoih"))); - model = BinaryData.fromObject(model).toObject(DatabaseServerFullResourceNames.class); - Assertions.assertEquals("tmmjihyeozph", model.virtualMachines().get(0).vmName()); - Assertions.assertEquals("auyqncygupkv", model.virtualMachines().get(0).hostname()); - Assertions.assertEquals("scw", model.virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("evzhfsto", model.virtualMachines().get(0).dataDiskNames().get("ypelmcu").get(0)); - Assertions.assertEquals("ixbjx", model.availabilitySetName()); - Assertions.assertEquals("n", model.loadBalancer().loadBalancerName()); - Assertions.assertEquals("coolsttpkiwkkb", model.loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("rywvtylbfpn", model.loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("fdntwjchrdgoih", model.loadBalancer().healthProbeNames().get(0)); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseVmDetailsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseVmDetailsTests.java deleted file mode 100644 index 72cf0a605123..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DatabaseVmDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; - -public final class DatabaseVmDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseVmDetails model = - BinaryData - .fromString( - "{\"virtualMachineId\":\"yxzk\",\"status\":\"SoftShutdown\",\"storageDetails\":[{\"id\":\"oklyaxuconuq\"}]}") - .toObject(DatabaseVmDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseVmDetails model = new DatabaseVmDetails(); - model = BinaryData.fromObject(model).toObject(DatabaseVmDetails.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeployerVmPackagesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeployerVmPackagesTests.java deleted file mode 100644 index 98df3d6396cc..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeployerVmPackagesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DeployerVmPackages; -import org.junit.jupiter.api.Assertions; - -public final class DeployerVmPackagesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeployerVmPackages model = - BinaryData - .fromString("{\"url\":\"yujviylwdshfssn\",\"storageAccountId\":\"gy\"}") - .toObject(DeployerVmPackages.class); - Assertions.assertEquals("yujviylwdshfssn", model.url()); - Assertions.assertEquals("gy", model.storageAccountId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeployerVmPackages model = new DeployerVmPackages().withUrl("yujviylwdshfssn").withStorageAccountId("gy"); - model = BinaryData.fromObject(model).toObject(DeployerVmPackages.class); - Assertions.assertEquals("yujviylwdshfssn", model.url()); - Assertions.assertEquals("gy", model.storageAccountId()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentConfigurationTests.java deleted file mode 100644 index f9f24ee25654..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentConfigurationTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DeploymentConfiguration; -import com.azure.resourcemanager.workloads.models.InfrastructureConfiguration; -import com.azure.resourcemanager.workloads.models.SoftwareConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentConfiguration model = - BinaryData - .fromString( - "{\"configurationType\":\"Deployment\",\"appLocation\":\"opqgikyzirtxdyux\",\"infrastructureConfiguration\":{\"deploymentType\":\"InfrastructureConfiguration\",\"appResourceGroup\":\"jntpsewgioilqu\"},\"softwareConfiguration\":{\"softwareInstallationType\":\"SoftwareConfiguration\"}}") - .toObject(DeploymentConfiguration.class); - Assertions.assertEquals("opqgikyzirtxdyux", model.appLocation()); - Assertions.assertEquals("jntpsewgioilqu", model.infrastructureConfiguration().appResourceGroup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentConfiguration model = - new DeploymentConfiguration() - .withAppLocation("opqgikyzirtxdyux") - .withInfrastructureConfiguration( - new InfrastructureConfiguration().withAppResourceGroup("jntpsewgioilqu")) - .withSoftwareConfiguration(new SoftwareConfiguration()); - model = BinaryData.fromObject(model).toObject(DeploymentConfiguration.class); - Assertions.assertEquals("opqgikyzirtxdyux", model.appLocation()); - Assertions.assertEquals("jntpsewgioilqu", model.infrastructureConfiguration().appResourceGroup()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentWithOSConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentWithOSConfigurationTests.java deleted file mode 100644 index 1b750315cf7f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DeploymentWithOSConfigurationTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DeployerVmPackages; -import com.azure.resourcemanager.workloads.models.DeploymentWithOSConfiguration; -import com.azure.resourcemanager.workloads.models.InfrastructureConfiguration; -import com.azure.resourcemanager.workloads.models.OsSapConfiguration; -import com.azure.resourcemanager.workloads.models.SoftwareConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentWithOSConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentWithOSConfiguration model = - BinaryData - .fromString( - "{\"configurationType\":\"DeploymentWithOSConfig\",\"appLocation\":\"dxtqmieoxo\",\"infrastructureConfiguration\":{\"deploymentType\":\"InfrastructureConfiguration\",\"appResourceGroup\":\"gufhyaomtbg\"},\"softwareConfiguration\":{\"softwareInstallationType\":\"SoftwareConfiguration\"},\"osSapConfiguration\":{\"deployerVmPackages\":{\"url\":\"rvk\",\"storageAccountId\":\"ovjzhpjbibgjmfx\"},\"sapFqdn\":\"vfcluyovwxnbkfe\"}}") - .toObject(DeploymentWithOSConfiguration.class); - Assertions.assertEquals("dxtqmieoxo", model.appLocation()); - Assertions.assertEquals("gufhyaomtbg", model.infrastructureConfiguration().appResourceGroup()); - Assertions.assertEquals("rvk", model.osSapConfiguration().deployerVmPackages().url()); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.osSapConfiguration().deployerVmPackages().storageAccountId()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.osSapConfiguration().sapFqdn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentWithOSConfiguration model = - new DeploymentWithOSConfiguration() - .withAppLocation("dxtqmieoxo") - .withInfrastructureConfiguration(new InfrastructureConfiguration().withAppResourceGroup("gufhyaomtbg")) - .withSoftwareConfiguration(new SoftwareConfiguration()) - .withOsSapConfiguration( - new OsSapConfiguration() - .withDeployerVmPackages( - new DeployerVmPackages().withUrl("rvk").withStorageAccountId("ovjzhpjbibgjmfx")) - .withSapFqdn("vfcluyovwxnbkfe")); - model = BinaryData.fromObject(model).toObject(DeploymentWithOSConfiguration.class); - Assertions.assertEquals("dxtqmieoxo", model.appLocation()); - Assertions.assertEquals("gufhyaomtbg", model.infrastructureConfiguration().appResourceGroup()); - Assertions.assertEquals("rvk", model.osSapConfiguration().deployerVmPackages().url()); - Assertions.assertEquals("ovjzhpjbibgjmfx", model.osSapConfiguration().deployerVmPackages().storageAccountId()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.osSapConfiguration().sapFqdn()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiscoveryConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiscoveryConfigurationTests.java deleted file mode 100644 index f09aad37f903..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiscoveryConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiscoveryConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveryConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveryConfiguration model = - BinaryData - .fromString( - "{\"configurationType\":\"Discovery\",\"centralServerVmId\":\"nsvbuswdv\",\"managedRgStorageAccountName\":\"ybycnunvj\",\"appLocation\":\"tkfa\"}") - .toObject(DiscoveryConfiguration.class); - Assertions.assertEquals("nsvbuswdv", model.centralServerVmId()); - Assertions.assertEquals("ybycnunvj", model.managedRgStorageAccountName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveryConfiguration model = - new DiscoveryConfiguration() - .withCentralServerVmId("nsvbuswdv") - .withManagedRgStorageAccountName("ybycnunvj"); - model = BinaryData.fromObject(model).toObject(DiscoveryConfiguration.class); - Assertions.assertEquals("nsvbuswdv", model.centralServerVmId()); - Assertions.assertEquals("ybycnunvj", model.managedRgStorageAccountName()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskConfigurationTests.java deleted file mode 100644 index 8ff35f3f69b8..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskConfigurationTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiskConfiguration; -import com.azure.resourcemanager.workloads.models.DiskSku; -import com.azure.resourcemanager.workloads.models.DiskSkuName; -import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DiskConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskConfiguration model = - BinaryData - .fromString( - "{\"diskVolumeConfigurations\":{\"ivgvvcna\":{\"count\":3900047479392463058,\"sizeGB\":4740858947759401461,\"sku\":{\"name\":\"Premium_LRS\"}},\"eedndrdvstkwqqtc\":{\"count\":8913535749004515550,\"sizeGB\":5279516661370439683,\"sku\":{\"name\":\"Premium_ZRS\"}},\"aygdvwvgpioh\":{\"count\":2777563543070243433,\"sizeGB\":6465025791585269802,\"sku\":{\"name\":\"UltraSSD_LRS\"}}}}") - .toObject(DiskConfiguration.class); - Assertions.assertEquals(3900047479392463058L, model.diskVolumeConfigurations().get("ivgvvcna").count()); - Assertions.assertEquals(4740858947759401461L, model.diskVolumeConfigurations().get("ivgvvcna").sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_LRS, model.diskVolumeConfigurations().get("ivgvvcna").sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskConfiguration model = - new DiskConfiguration() - .withDiskVolumeConfigurations( - mapOf( - "ivgvvcna", - new DiskVolumeConfiguration() - .withCount(3900047479392463058L) - .withSizeGB(4740858947759401461L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), - "eedndrdvstkwqqtc", - new DiskVolumeConfiguration() - .withCount(8913535749004515550L) - .withSizeGB(5279516661370439683L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_ZRS)), - "aygdvwvgpioh", - new DiskVolumeConfiguration() - .withCount(2777563543070243433L) - .withSizeGB(6465025791585269802L) - .withSku(new DiskSku().withName(DiskSkuName.ULTRA_SSD_LRS)))); - model = BinaryData.fromObject(model).toObject(DiskConfiguration.class); - Assertions.assertEquals(3900047479392463058L, model.diskVolumeConfigurations().get("ivgvvcna").count()); - Assertions.assertEquals(4740858947759401461L, model.diskVolumeConfigurations().get("ivgvvcna").sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_LRS, model.diskVolumeConfigurations().get("ivgvvcna").sku().name()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskDetailsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskDetailsTests.java deleted file mode 100644 index dab23ffce6bd..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskDetailsTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiskDetails; -import com.azure.resourcemanager.workloads.models.DiskSku; -import com.azure.resourcemanager.workloads.models.DiskSkuName; -import org.junit.jupiter.api.Assertions; - -public final class DiskDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskDetails model = - BinaryData - .fromString( - "{\"sku\":{\"name\":\"Standard_LRS\"},\"sizeGB\":5612595688544592348,\"minimumSupportedDiskCount\":8451324547573976029,\"maximumSupportedDiskCount\":4274110393583912034,\"iopsReadWrite\":5470433313051888734,\"mbpsReadWrite\":7911846487069687431,\"diskTier\":\"nwzsymg\"}") - .toObject(DiskDetails.class); - Assertions.assertEquals(DiskSkuName.STANDARD_LRS, model.sku().name()); - Assertions.assertEquals(5612595688544592348L, model.sizeGB()); - Assertions.assertEquals(8451324547573976029L, model.minimumSupportedDiskCount()); - Assertions.assertEquals(4274110393583912034L, model.maximumSupportedDiskCount()); - Assertions.assertEquals(5470433313051888734L, model.iopsReadWrite()); - Assertions.assertEquals(7911846487069687431L, model.mbpsReadWrite()); - Assertions.assertEquals("nwzsymg", model.diskTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskDetails model = - new DiskDetails() - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_LRS)) - .withSizeGB(5612595688544592348L) - .withMinimumSupportedDiskCount(8451324547573976029L) - .withMaximumSupportedDiskCount(4274110393583912034L) - .withIopsReadWrite(5470433313051888734L) - .withMbpsReadWrite(7911846487069687431L) - .withDiskTier("nwzsymg"); - model = BinaryData.fromObject(model).toObject(DiskDetails.class); - Assertions.assertEquals(DiskSkuName.STANDARD_LRS, model.sku().name()); - Assertions.assertEquals(5612595688544592348L, model.sizeGB()); - Assertions.assertEquals(8451324547573976029L, model.minimumSupportedDiskCount()); - Assertions.assertEquals(4274110393583912034L, model.maximumSupportedDiskCount()); - Assertions.assertEquals(5470433313051888734L, model.iopsReadWrite()); - Assertions.assertEquals(7911846487069687431L, model.mbpsReadWrite()); - Assertions.assertEquals("nwzsymg", model.diskTier()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskSkuTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskSkuTests.java deleted file mode 100644 index b6fb0b040b68..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskSkuTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiskSku; -import com.azure.resourcemanager.workloads.models.DiskSkuName; -import org.junit.jupiter.api.Assertions; - -public final class DiskSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskSku model = BinaryData.fromString("{\"name\":\"Premium_LRS\"}").toObject(DiskSku.class); - Assertions.assertEquals(DiskSkuName.PREMIUM_LRS, model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskSku model = new DiskSku().withName(DiskSkuName.PREMIUM_LRS); - model = BinaryData.fromObject(model).toObject(DiskSku.class); - Assertions.assertEquals(DiskSkuName.PREMIUM_LRS, model.name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskVolumeConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskVolumeConfigurationTests.java deleted file mode 100644 index 87e40f818424..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/DiskVolumeConfigurationTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiskSku; -import com.azure.resourcemanager.workloads.models.DiskSkuName; -import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DiskVolumeConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiskVolumeConfiguration model = - BinaryData - .fromString( - "{\"count\":2263722670392996598,\"sizeGB\":8352976901787855054,\"sku\":{\"name\":\"Premium_ZRS\"}}") - .toObject(DiskVolumeConfiguration.class); - Assertions.assertEquals(2263722670392996598L, model.count()); - Assertions.assertEquals(8352976901787855054L, model.sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_ZRS, model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiskVolumeConfiguration model = - new DiskVolumeConfiguration() - .withCount(2263722670392996598L) - .withSizeGB(8352976901787855054L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_ZRS)); - model = BinaryData.fromObject(model).toObject(DiskVolumeConfiguration.class); - Assertions.assertEquals(2263722670392996598L, model.count()); - Assertions.assertEquals(8352976901787855054L, model.sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_ZRS, model.sku().name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueReplicationServerPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueReplicationServerPropertiesTests.java deleted file mode 100644 index e4d34a101c24..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueReplicationServerPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.EnqueueReplicationServerProperties; - -public final class EnqueueReplicationServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnqueueReplicationServerProperties model = - BinaryData - .fromString( - "{\"ersVersion\":\"EnqueueReplicator1\",\"instanceNo\":\"qeojnxqbzvddntw\",\"hostname\":\"eic\",\"kernelVersion\":\"w\",\"kernelPatch\":\"zao\",\"ipAddress\":\"uhrhcffcyddgl\",\"health\":\"Unknown\"}") - .toObject(EnqueueReplicationServerProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnqueueReplicationServerProperties model = new EnqueueReplicationServerProperties(); - model = BinaryData.fromObject(model).toObject(EnqueueReplicationServerProperties.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueServerPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueServerPropertiesTests.java deleted file mode 100644 index a7715da4ad2c..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/EnqueueServerPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.EnqueueServerProperties; - -public final class EnqueueServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnqueueServerProperties model = - BinaryData - .fromString( - "{\"hostname\":\"kexxppof\",\"ipAddress\":\"axcfjpgddtocjjx\",\"port\":1101586984084483374,\"health\":\"Healthy\"}") - .toObject(EnqueueServerProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnqueueServerProperties model = new EnqueueServerProperties(); - model = BinaryData.fromObject(model).toObject(EnqueueServerProperties.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ExternalInstallationSoftwareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ExternalInstallationSoftwareConfigurationTests.java deleted file mode 100644 index 79e16b5aa37d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ExternalInstallationSoftwareConfigurationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ExternalInstallationSoftwareConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ExternalInstallationSoftwareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalInstallationSoftwareConfiguration model = - BinaryData - .fromString("{\"softwareInstallationType\":\"External\",\"centralServerVmId\":\"hqxvcxgfrpdsofbs\"}") - .toObject(ExternalInstallationSoftwareConfiguration.class); - Assertions.assertEquals("hqxvcxgfrpdsofbs", model.centralServerVmId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalInstallationSoftwareConfiguration model = - new ExternalInstallationSoftwareConfiguration().withCentralServerVmId("hqxvcxgfrpdsofbs"); - model = BinaryData.fromObject(model).toObject(ExternalInstallationSoftwareConfiguration.class); - Assertions.assertEquals("hqxvcxgfrpdsofbs", model.centralServerVmId()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/FileShareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/FileShareConfigurationTests.java deleted file mode 100644 index a8a4534bf194..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/FileShareConfigurationTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.FileShareConfiguration; - -public final class FileShareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileShareConfiguration model = - BinaryData - .fromString("{\"configurationType\":\"FileShareConfiguration\"}") - .toObject(FileShareConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileShareConfiguration model = new FileShareConfiguration(); - model = BinaryData.fromObject(model).toObject(FileShareConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/GatewayServerPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/GatewayServerPropertiesTests.java deleted file mode 100644 index e75d54c5bc74..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/GatewayServerPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.GatewayServerProperties; - -public final class GatewayServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GatewayServerProperties model = - BinaryData - .fromString("{\"port\":5563523584093599698,\"health\":\"Healthy\"}") - .toObject(GatewayServerProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GatewayServerProperties model = new GatewayServerProperties(); - model = BinaryData.fromObject(model).toObject(GatewayServerProperties.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/HighAvailabilityConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/HighAvailabilityConfigurationTests.java deleted file mode 100644 index e97b64675072..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/HighAvailabilityConfigurationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.HighAvailabilityConfiguration; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import org.junit.jupiter.api.Assertions; - -public final class HighAvailabilityConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HighAvailabilityConfiguration model = - BinaryData - .fromString("{\"highAvailabilityType\":\"AvailabilitySet\"}") - .toObject(HighAvailabilityConfiguration.class); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_SET, model.highAvailabilityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HighAvailabilityConfiguration model = - new HighAvailabilityConfiguration().withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET); - model = BinaryData.fromObject(model).toObject(HighAvailabilityConfiguration.class); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_SET, model.highAvailabilityType()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ImageReferenceTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ImageReferenceTests.java deleted file mode 100644 index 4e3e22d8eaba..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ImageReferenceTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ImageReference; -import org.junit.jupiter.api.Assertions; - -public final class ImageReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ImageReference model = - BinaryData - .fromString( - "{\"publisher\":\"iysui\",\"offer\":\"ynkedyatrwyhqmib\",\"sku\":\"hwit\",\"version\":\"ypyynpcdpumnzg\"}") - .toObject(ImageReference.class); - Assertions.assertEquals("iysui", model.publisher()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.offer()); - Assertions.assertEquals("hwit", model.sku()); - Assertions.assertEquals("ypyynpcdpumnzg", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ImageReference model = - new ImageReference() - .withPublisher("iysui") - .withOffer("ynkedyatrwyhqmib") - .withSku("hwit") - .withVersion("ypyynpcdpumnzg"); - model = BinaryData.fromObject(model).toObject(ImageReference.class); - Assertions.assertEquals("iysui", model.publisher()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.offer()); - Assertions.assertEquals("hwit", model.sku()); - Assertions.assertEquals("ypyynpcdpumnzg", model.version()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/InfrastructureConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/InfrastructureConfigurationTests.java deleted file mode 100644 index 5cdfb68f6402..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/InfrastructureConfigurationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.InfrastructureConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class InfrastructureConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InfrastructureConfiguration model = - BinaryData - .fromString("{\"deploymentType\":\"InfrastructureConfiguration\",\"appResourceGroup\":\"khly\"}") - .toObject(InfrastructureConfiguration.class); - Assertions.assertEquals("khly", model.appResourceGroup()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InfrastructureConfiguration model = new InfrastructureConfiguration().withAppResourceGroup("khly"); - model = BinaryData.fromObject(model).toObject(InfrastructureConfiguration.class); - Assertions.assertEquals("khly", model.appResourceGroup()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerDetailsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerDetailsTests.java deleted file mode 100644 index a76a9bffd893..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.LoadBalancerDetails; - -public final class LoadBalancerDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LoadBalancerDetails model = - BinaryData.fromString("{\"id\":\"jqkwpyeicx\"}").toObject(LoadBalancerDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LoadBalancerDetails model = new LoadBalancerDetails(); - model = BinaryData.fromObject(model).toObject(LoadBalancerDetails.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerResourceNamesTests.java deleted file mode 100644 index a279ef298bfd..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/LoadBalancerResourceNamesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.LoadBalancerResourceNames; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LoadBalancerResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LoadBalancerResourceNames model = - BinaryData - .fromString( - "{\"loadBalancerName\":\"ho\",\"frontendIpConfigurationNames\":[\"zudphqamvdkfw\",\"nwcvtbvkayhmtnv\"],\"backendPoolNames\":[\"atkzwpcnpw\",\"cjaesgvvs\",\"cyajguqf\"],\"healthProbeNames\":[\"gzlvdnkfxu\"]}") - .toObject(LoadBalancerResourceNames.class); - Assertions.assertEquals("ho", model.loadBalancerName()); - Assertions.assertEquals("zudphqamvdkfw", model.frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("atkzwpcnpw", model.backendPoolNames().get(0)); - Assertions.assertEquals("gzlvdnkfxu", model.healthProbeNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LoadBalancerResourceNames model = - new LoadBalancerResourceNames() - .withLoadBalancerName("ho") - .withFrontendIpConfigurationNames(Arrays.asList("zudphqamvdkfw", "nwcvtbvkayhmtnv")) - .withBackendPoolNames(Arrays.asList("atkzwpcnpw", "cjaesgvvs", "cyajguqf")) - .withHealthProbeNames(Arrays.asList("gzlvdnkfxu")); - model = BinaryData.fromObject(model).toObject(LoadBalancerResourceNames.class); - Assertions.assertEquals("ho", model.loadBalancerName()); - Assertions.assertEquals("zudphqamvdkfw", model.frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("atkzwpcnpw", model.backendPoolNames().get(0)); - Assertions.assertEquals("gzlvdnkfxu", model.healthProbeNames().get(0)); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ManagedRGConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ManagedRGConfigurationTests.java deleted file mode 100644 index 0e063cca9617..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ManagedRGConfigurationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ManagedRGConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedRGConfiguration model = - BinaryData.fromString("{\"name\":\"jvwmfda\"}").toObject(ManagedRGConfiguration.class); - Assertions.assertEquals("jvwmfda", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedRGConfiguration model = new ManagedRGConfiguration().withName("jvwmfda"); - model = BinaryData.fromObject(model).toObject(ManagedRGConfiguration.class); - Assertions.assertEquals("jvwmfda", model.name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MessageServerPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MessageServerPropertiesTests.java deleted file mode 100644 index 90e6e094c427..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MessageServerPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.MessageServerProperties; - -public final class MessageServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MessageServerProperties model = - BinaryData - .fromString( - "{\"msPort\":2253353584396123190,\"internalMsPort\":4756233524739772773,\"httpPort\":159667534034002555,\"httpsPort\":8346750306601023663,\"hostname\":\"zrlovmclwhijcoej\",\"ipAddress\":\"bzaqsqsycbkbfk\",\"health\":\"Healthy\"}") - .toObject(MessageServerProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MessageServerProperties model = new MessageServerProperties(); - model = BinaryData.fromObject(model).toObject(MessageServerProperties.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorListResultTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorListResultTests.java deleted file mode 100644 index b7d575db9265..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorListResultTests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.MonitorInner; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.MonitorListResult; -import com.azure.resourcemanager.workloads.models.RoutingPreference; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MonitorListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitorListResult model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Updating\",\"appLocation\":\"savjcbpwxqps\",\"routingPreference\":\"RouteAll\",\"zoneRedundancyPreference\":\"tguvriuhp\",\"logAnalyticsWorkspaceArmId\":\"dyvxqtayriww\",\"monitorSubnet\":\"yqbexrmcqibycno\",\"msiArmId\":\"knme\",\"storageAccountArmId\":\"sgzvahapjyzhpv\"},\"location\":\"zcjrvxdjzlmwlx\",\"tags\":{\"nnprn\":\"gfhzovawjvzunlut\"},\"id\":\"i\",\"name\":\"eilpjzuaejxdu\",\"type\":\"tskzbbtdzumveek\"},{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Creating\",\"appLocation\":\"p\",\"routingPreference\":\"RouteAll\",\"zoneRedundancyPreference\":\"ofd\",\"logAnalyticsWorkspaceArmId\":\"us\",\"monitorSubnet\":\"touwaboekqv\",\"msiArmId\":\"lns\",\"storageAccountArmId\":\"bxwyjsflhhcaa\"},\"location\":\"jixisxyawjoyaqcs\",\"tags\":{\"zyexzn\":\"pkii\",\"bnxknalaulppg\":\"lixhnrztfol\",\"gvpgy\":\"dtpnapnyiropuhp\",\"n\":\"gqgitxmedjvcsl\"},\"id\":\"wwncwzzhxgk\",\"name\":\"rmgucnap\",\"type\":\"t\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Updating\",\"appLocation\":\"d\",\"routingPreference\":\"RouteAll\",\"zoneRedundancyPreference\":\"qbuaceopzfqr\",\"logAnalyticsWorkspaceArmId\":\"ao\",\"monitorSubnet\":\"pcqeqx\",\"msiArmId\":\"z\",\"storageAccountArmId\":\"hzxct\"},\"location\":\"gbkdmoizpos\",\"tags\":{\"qjhhkxbpv\":\"rcfbunrm\",\"swbxqz\":\"ymjhxxjyngudivkr\"},\"id\":\"szjfauvjfdxxivet\",\"name\":\"t\",\"type\":\"qaqtdoqmcbxvwvxy\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Creating\",\"appLocation\":\"blytk\",\"routingPreference\":\"Default\",\"zoneRedundancyPreference\":\"ewwwfbkrvrnsv\",\"logAnalyticsWorkspaceArmId\":\"johxcrsb\",\"monitorSubnet\":\"vasrruvwb\",\"msiArmId\":\"qfsubcgjbirx\",\"storageAccountArmId\":\"ybsrfbjfdtwss\"},\"location\":\"ftpvjzbexil\",\"tags\":{\"jmkcjhwqytj\":\"fqqnvwpmqtaruo\",\"jewgdrjerv\":\"ybn\"},\"id\":\"aen\",\"name\":\"pehindoygm\",\"type\":\"fthnzdn\"}],\"nextLink\":\"l\"}") - .toObject(MonitorListResult.class); - Assertions.assertEquals("zcjrvxdjzlmwlx", model.value().get(0).location()); - Assertions.assertEquals("gfhzovawjvzunlut", model.value().get(0).tags().get("nnprn")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("savjcbpwxqps", model.value().get(0).appLocation()); - Assertions.assertEquals(RoutingPreference.ROUTE_ALL, model.value().get(0).routingPreference()); - Assertions.assertEquals("tguvriuhp", model.value().get(0).zoneRedundancyPreference()); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).logAnalyticsWorkspaceArmId()); - Assertions.assertEquals("yqbexrmcqibycno", model.value().get(0).monitorSubnet()); - Assertions.assertEquals("l", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitorListResult model = - new MonitorListResult() - .withValue( - Arrays - .asList( - new MonitorInner() - .withLocation("zcjrvxdjzlmwlx") - .withTags(mapOf("nnprn", "gfhzovawjvzunlut")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withAppLocation("savjcbpwxqps") - .withRoutingPreference(RoutingPreference.ROUTE_ALL) - .withZoneRedundancyPreference("tguvriuhp") - .withLogAnalyticsWorkspaceArmId("dyvxqtayriww") - .withMonitorSubnet("yqbexrmcqibycno"), - new MonitorInner() - .withLocation("jixisxyawjoyaqcs") - .withTags( - mapOf( - "zyexzn", - "pkii", - "bnxknalaulppg", - "lixhnrztfol", - "gvpgy", - "dtpnapnyiropuhp", - "n", - "gqgitxmedjvcsl")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withAppLocation("p") - .withRoutingPreference(RoutingPreference.ROUTE_ALL) - .withZoneRedundancyPreference("ofd") - .withLogAnalyticsWorkspaceArmId("us") - .withMonitorSubnet("touwaboekqv"), - new MonitorInner() - .withLocation("gbkdmoizpos") - .withTags(mapOf("qjhhkxbpv", "rcfbunrm", "swbxqz", "ymjhxxjyngudivkr")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withAppLocation("d") - .withRoutingPreference(RoutingPreference.ROUTE_ALL) - .withZoneRedundancyPreference("qbuaceopzfqr") - .withLogAnalyticsWorkspaceArmId("ao") - .withMonitorSubnet("pcqeqx"), - new MonitorInner() - .withLocation("ftpvjzbexil") - .withTags(mapOf("jmkcjhwqytj", "fqqnvwpmqtaruo", "jewgdrjerv", "ybn")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withAppLocation("blytk") - .withRoutingPreference(RoutingPreference.DEFAULT) - .withZoneRedundancyPreference("ewwwfbkrvrnsv") - .withLogAnalyticsWorkspaceArmId("johxcrsb") - .withMonitorSubnet("vasrruvwb"))) - .withNextLink("l"); - model = BinaryData.fromObject(model).toObject(MonitorListResult.class); - Assertions.assertEquals("zcjrvxdjzlmwlx", model.value().get(0).location()); - Assertions.assertEquals("gfhzovawjvzunlut", model.value().get(0).tags().get("nnprn")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("savjcbpwxqps", model.value().get(0).appLocation()); - Assertions.assertEquals(RoutingPreference.ROUTE_ALL, model.value().get(0).routingPreference()); - Assertions.assertEquals("tguvriuhp", model.value().get(0).zoneRedundancyPreference()); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).logAnalyticsWorkspaceArmId()); - Assertions.assertEquals("yqbexrmcqibycno", model.value().get(0).monitorSubnet()); - Assertions.assertEquals("l", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteMockTests.java deleted file mode 100644 index bc1f7da41f1f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MonitorsDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 MonitorsDeleteMockTests { - @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 = - "{\"id\":\"smgbzahgxqdl\",\"name\":\"tlt\",\"status\":\"ap\",\"percentComplete\":8.252752,\"startTime\":\"2021-01-18T16:57:33Z\",\"endTime\":\"2021-06-30T17:25:30Z\",\"operations\":[{\"id\":\"mznnbsoqeqalarvl\",\"name\":\"un\",\"status\":\"tgfebwln\",\"percentComplete\":36.78445,\"startTime\":\"2021-02-09T00:26:12Z\",\"endTime\":\"2021-12-01T07:49:22Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.monitors().delete("aosrxuz", "oamktcq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("smgbzahgxqdl", response.id()); - Assertions.assertEquals("tlt", response.name()); - Assertions.assertEquals("ap", response.status()); - Assertions.assertEquals(8.252752F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T16:57:33Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T17:25:30Z"), response.endTime()); - Assertions.assertEquals("mznnbsoqeqalarvl", response.operations().get(0).id()); - Assertions.assertEquals("un", response.operations().get(0).name()); - Assertions.assertEquals("tgfebwln", response.operations().get(0).status()); - Assertions.assertEquals(36.78445F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T00:26:12Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T07:49:22Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MountFileShareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MountFileShareConfigurationTests.java deleted file mode 100644 index eff02489f240..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/MountFileShareConfigurationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.MountFileShareConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class MountFileShareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MountFileShareConfiguration model = - BinaryData - .fromString( - "{\"configurationType\":\"Mount\",\"id\":\"lfltka\",\"privateEndpointId\":\"jvefkdlfoakggkfp\"}") - .toObject(MountFileShareConfiguration.class); - Assertions.assertEquals("lfltka", model.id()); - Assertions.assertEquals("jvefkdlfoakggkfp", model.privateEndpointId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MountFileShareConfiguration model = - new MountFileShareConfiguration().withId("lfltka").withPrivateEndpointId("jvefkdlfoakggkfp"); - model = BinaryData.fromObject(model).toObject(MountFileShareConfiguration.class); - Assertions.assertEquals("lfltka", model.id()); - Assertions.assertEquals("jvefkdlfoakggkfp", model.privateEndpointId()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkConfigurationTests.java deleted file mode 100644 index 5991887bdc8b..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkConfigurationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.NetworkConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class NetworkConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkConfiguration model = - BinaryData.fromString("{\"isSecondaryIpEnabled\":false}").toObject(NetworkConfiguration.class); - Assertions.assertEquals(false, model.isSecondaryIpEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkConfiguration model = new NetworkConfiguration().withIsSecondaryIpEnabled(false); - model = BinaryData.fromObject(model).toObject(NetworkConfiguration.class); - Assertions.assertEquals(false, model.isSecondaryIpEnabled()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkInterfaceResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkInterfaceResourceNamesTests.java deleted file mode 100644 index 730831e9ff46..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/NetworkInterfaceResourceNamesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.NetworkInterfaceResourceNames; -import org.junit.jupiter.api.Assertions; - -public final class NetworkInterfaceResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkInterfaceResourceNames model = - BinaryData - .fromString("{\"networkInterfaceName\":\"ldsyuuximerqfob\"}") - .toObject(NetworkInterfaceResourceNames.class); - Assertions.assertEquals("ldsyuuximerqfob", model.networkInterfaceName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkInterfaceResourceNames model = - new NetworkInterfaceResourceNames().withNetworkInterfaceName("ldsyuuximerqfob"); - model = BinaryData.fromObject(model).toObject(NetworkInterfaceResourceNames.class); - Assertions.assertEquals("ldsyuuximerqfob", model.networkInterfaceName()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OSConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OSConfigurationTests.java deleted file mode 100644 index 447b772634ba..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OSConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.OSConfiguration; - -public final class OSConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OSConfiguration model = - BinaryData.fromString("{\"osType\":\"OSConfiguration\"}").toObject(OSConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OSConfiguration model = new OSConfiguration(); - model = BinaryData.fromObject(model).toObject(OSConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationDisplayTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationDisplayTests.java deleted file mode 100644 index c1f964128977..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"ljphuopxodl\",\"resource\":\"ynt\",\"operation\":\"zihleosjswsr\",\"description\":\"lyzrpzbchckqqzqi\"}") - .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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationInnerTests.java deleted file mode 100644 index 47fe0ad46818..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.OperationInner; -import com.azure.resourcemanager.workloads.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"aeneqnzarrwl\",\"isDataAction\":false,\"display\":{\"provider\":\"fqka\",\"resource\":\"wiipfpub\",\"operation\":\"bwwift\",\"description\":\"qkvpuvksgplsakn\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationListResultTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationListResultTests.java deleted file mode 100644 index 138b63869550..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"cnqxwbpokulpi\",\"isDataAction\":false,\"display\":{\"provider\":\"sipqii\",\"resource\":\"yuq\",\"operation\":\"pqlpq\",\"description\":\"ciuqgbdb\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"btkuwhh\",\"isDataAction\":true,\"display\":{\"provider\":\"joxafnndlpi\",\"resource\":\"koymkcd\",\"operation\":\"bpkkpwdre\",\"description\":\"ovvqfovljxywsu\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"dsytgadgvr\"}") - .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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationStatusResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationStatusResultInnerTests.java deleted file mode 100644 index e2d4c61417ca..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationStatusResultInnerTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.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\":\"wzo\",\"name\":\"j\",\"status\":\"felluwfzitonpe\",\"percentComplete\":68.49165,\"startTime\":\"2021-02-04T10:43:39Z\",\"endTime\":\"2021-10-08T03:48:51Z\",\"operations\":[{\"id\":\"pdvhpfxxypin\",\"name\":\"mayhuybbkpodepoo\",\"status\":\"inuvamiheogn\",\"percentComplete\":41.474594,\"startTime\":\"2021-11-26T09:10:23Z\",\"endTime\":\"2021-07-04T09:54:35Z\",\"operations\":[]},{\"id\":\"si\",\"name\":\"evcciqihnhun\",\"status\":\"bwjzr\",\"percentComplete\":74.57618,\"startTime\":\"2021-11-20T13:28:32Z\",\"endTime\":\"2021-05-21T15:18:02Z\",\"operations\":[]}]}") - .toObject(OperationStatusResultInner.class); - Assertions.assertEquals("wzo", model.id()); - Assertions.assertEquals("j", model.name()); - Assertions.assertEquals("felluwfzitonpe", model.status()); - Assertions.assertEquals(68.49165F, model.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T10:43:39Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T03:48:51Z"), model.endTime()); - Assertions.assertEquals("pdvhpfxxypin", model.operations().get(0).id()); - Assertions.assertEquals("mayhuybbkpodepoo", model.operations().get(0).name()); - Assertions.assertEquals("inuvamiheogn", model.operations().get(0).status()); - Assertions.assertEquals(41.474594F, model.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T09:10:23Z"), model.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T09:54:35Z"), model.operations().get(0).endTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationStatusResultInner model = - new OperationStatusResultInner() - .withId("wzo") - .withName("j") - .withStatus("felluwfzitonpe") - .withPercentComplete(68.49165F) - .withStartTime(OffsetDateTime.parse("2021-02-04T10:43:39Z")) - .withEndTime(OffsetDateTime.parse("2021-10-08T03:48:51Z")) - .withOperations( - Arrays - .asList( - new OperationStatusResultInner() - .withId("pdvhpfxxypin") - .withName("mayhuybbkpodepoo") - .withStatus("inuvamiheogn") - .withPercentComplete(41.474594F) - .withStartTime(OffsetDateTime.parse("2021-11-26T09:10:23Z")) - .withEndTime(OffsetDateTime.parse("2021-07-04T09:54:35Z")) - .withOperations(Arrays.asList()), - new OperationStatusResultInner() - .withId("si") - .withName("evcciqihnhun") - .withStatus("bwjzr") - .withPercentComplete(74.57618F) - .withStartTime(OffsetDateTime.parse("2021-11-20T13:28:32Z")) - .withEndTime(OffsetDateTime.parse("2021-05-21T15:18:02Z")) - .withOperations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(OperationStatusResultInner.class); - Assertions.assertEquals("wzo", model.id()); - Assertions.assertEquals("j", model.name()); - Assertions.assertEquals("felluwfzitonpe", model.status()); - Assertions.assertEquals(68.49165F, model.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T10:43:39Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T03:48:51Z"), model.endTime()); - Assertions.assertEquals("pdvhpfxxypin", model.operations().get(0).id()); - Assertions.assertEquals("mayhuybbkpodepoo", model.operations().get(0).name()); - Assertions.assertEquals("inuvamiheogn", model.operations().get(0).status()); - Assertions.assertEquals(41.474594F, model.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T09:10:23Z"), model.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-04T09:54:35Z"), model.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDefinitionDisplayTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDefinitionDisplayTests.java deleted file mode 100644 index 7e6e3c4c5342..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDefinitionDisplayTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.OperationsDefinitionDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationsDefinitionDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsDefinitionDisplay model = - BinaryData - .fromString( - "{\"provider\":\"lihhyuspskasdvlm\",\"resource\":\"wdgzxulucv\",\"operation\":\"amrsreuzv\",\"description\":\"urisjnhnytxifqj\"}") - .toObject(OperationsDefinitionDisplay.class); - Assertions.assertEquals("lihhyuspskasdvlm", model.provider()); - Assertions.assertEquals("wdgzxulucv", model.resource()); - Assertions.assertEquals("amrsreuzv", model.operation()); - Assertions.assertEquals("urisjnhnytxifqj", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsDefinitionDisplay model = - new OperationsDefinitionDisplay() - .withProvider("lihhyuspskasdvlm") - .withResource("wdgzxulucv") - .withOperation("amrsreuzv") - .withDescription("urisjnhnytxifqj"); - model = BinaryData.fromObject(model).toObject(OperationsDefinitionDisplay.class); - Assertions.assertEquals("lihhyuspskasdvlm", model.provider()); - Assertions.assertEquals("wdgzxulucv", model.resource()); - Assertions.assertEquals("amrsreuzv", model.operation()); - Assertions.assertEquals("urisjnhnytxifqj", model.description()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDisplayDefinitionTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDisplayDefinitionTests.java deleted file mode 100644 index 75868b3e634d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsDisplayDefinitionTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.OperationsDisplayDefinition; -import org.junit.jupiter.api.Assertions; - -public final class OperationsDisplayDefinitionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsDisplayDefinition model = - BinaryData - .fromString( - "{\"provider\":\"frymsgaojfmwnc\",\"resource\":\"tmr\",\"operation\":\"hirctymoxoftpipi\",\"description\":\"yczuhxacpq\"}") - .toObject(OperationsDisplayDefinition.class); - Assertions.assertEquals("frymsgaojfmwnc", model.provider()); - Assertions.assertEquals("tmr", model.resource()); - Assertions.assertEquals("hirctymoxoftpipi", model.operation()); - Assertions.assertEquals("yczuhxacpq", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsDisplayDefinition model = - new OperationsDisplayDefinition() - .withProvider("frymsgaojfmwnc") - .withResource("tmr") - .withOperation("hirctymoxoftpipi") - .withDescription("yczuhxacpq"); - model = BinaryData.fromObject(model).toObject(OperationsDisplayDefinition.class); - Assertions.assertEquals("frymsgaojfmwnc", model.provider()); - Assertions.assertEquals("tmr", model.resource()); - Assertions.assertEquals("hirctymoxoftpipi", model.operation()); - Assertions.assertEquals("yczuhxacpq", model.description()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsListMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsListMockTests.java deleted file mode 100644 index b677751f0a0c..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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\":\"fabuiyjibu\",\"isDataAction\":true,\"display\":{\"provider\":\"gneik\",\"resource\":\"gox\",\"operation\":\"iuqhibtozipqwj\",\"description\":\"mur\"},\"origin\":\"user,system\",\"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); - })); - - WorkloadsManager manager = - WorkloadsManager - .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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OsSapConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OsSapConfigurationTests.java deleted file mode 100644 index 193ec5452fae..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/OsSapConfigurationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DeployerVmPackages; -import com.azure.resourcemanager.workloads.models.OsSapConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class OsSapConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OsSapConfiguration model = - BinaryData - .fromString( - "{\"deployerVmPackages\":{\"url\":\"scyhwz\",\"storageAccountId\":\"irujbz\"},\"sapFqdn\":\"mvzzbtdcqvp\"}") - .toObject(OsSapConfiguration.class); - Assertions.assertEquals("scyhwz", model.deployerVmPackages().url()); - Assertions.assertEquals("irujbz", model.deployerVmPackages().storageAccountId()); - Assertions.assertEquals("mvzzbtdcqvp", model.sapFqdn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OsSapConfiguration model = - new OsSapConfiguration() - .withDeployerVmPackages(new DeployerVmPackages().withUrl("scyhwz").withStorageAccountId("irujbz")) - .withSapFqdn("mvzzbtdcqvp"); - model = BinaryData.fromObject(model).toObject(OsSapConfiguration.class); - Assertions.assertEquals("scyhwz", model.deployerVmPackages().url()); - Assertions.assertEquals("irujbz", model.deployerVmPackages().storageAccountId()); - Assertions.assertEquals("mvzzbtdcqvp", model.sapFqdn()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusHaClusterProviderInstancePropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusHaClusterProviderInstancePropertiesTests.java deleted file mode 100644 index c3d6460208bb..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusHaClusterProviderInstancePropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.PrometheusHaClusterProviderInstanceProperties; -import com.azure.resourcemanager.workloads.models.SslPreference; -import org.junit.jupiter.api.Assertions; - -public final class PrometheusHaClusterProviderInstancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrometheusHaClusterProviderInstanceProperties model = - BinaryData - .fromString( - "{\"providerType\":\"PrometheusHaCluster\",\"prometheusUrl\":\"x\",\"hostname\":\"czheyd\",\"sid\":\"dshmkxmaehvbbx\",\"clusterName\":\"iplt\",\"sslPreference\":\"ServerCertificate\",\"sslCertificateUri\":\"baxk\"}") - .toObject(PrometheusHaClusterProviderInstanceProperties.class); - Assertions.assertEquals("x", model.prometheusUrl()); - Assertions.assertEquals("czheyd", model.hostname()); - Assertions.assertEquals("dshmkxmaehvbbx", model.sid()); - Assertions.assertEquals("iplt", model.clusterName()); - Assertions.assertEquals(SslPreference.SERVER_CERTIFICATE, model.sslPreference()); - Assertions.assertEquals("baxk", model.sslCertificateUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrometheusHaClusterProviderInstanceProperties model = - new PrometheusHaClusterProviderInstanceProperties() - .withPrometheusUrl("x") - .withHostname("czheyd") - .withSid("dshmkxmaehvbbx") - .withClusterName("iplt") - .withSslPreference(SslPreference.SERVER_CERTIFICATE) - .withSslCertificateUri("baxk"); - model = BinaryData.fromObject(model).toObject(PrometheusHaClusterProviderInstanceProperties.class); - Assertions.assertEquals("x", model.prometheusUrl()); - Assertions.assertEquals("czheyd", model.hostname()); - Assertions.assertEquals("dshmkxmaehvbbx", model.sid()); - Assertions.assertEquals("iplt", model.clusterName()); - Assertions.assertEquals(SslPreference.SERVER_CERTIFICATE, model.sslPreference()); - Assertions.assertEquals("baxk", model.sslCertificateUri()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusOSProviderInstancePropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusOSProviderInstancePropertiesTests.java deleted file mode 100644 index 7f18037f996d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/PrometheusOSProviderInstancePropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.PrometheusOSProviderInstanceProperties; -import com.azure.resourcemanager.workloads.models.SslPreference; -import org.junit.jupiter.api.Assertions; - -public final class PrometheusOSProviderInstancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrometheusOSProviderInstanceProperties model = - BinaryData - .fromString( - "{\"providerType\":\"PrometheusOS\",\"prometheusUrl\":\"rhnj\",\"sslPreference\":\"Disabled\",\"sslCertificateUri\":\"v\",\"sapSid\":\"ovqfzge\"}") - .toObject(PrometheusOSProviderInstanceProperties.class); - Assertions.assertEquals("rhnj", model.prometheusUrl()); - Assertions.assertEquals(SslPreference.DISABLED, model.sslPreference()); - Assertions.assertEquals("v", model.sslCertificateUri()); - Assertions.assertEquals("ovqfzge", model.sapSid()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrometheusOSProviderInstanceProperties model = - new PrometheusOSProviderInstanceProperties() - .withPrometheusUrl("rhnj") - .withSslPreference(SslPreference.DISABLED) - .withSslCertificateUri("v") - .withSapSid("ovqfzge"); - model = BinaryData.fromObject(model).toObject(PrometheusOSProviderInstanceProperties.class); - Assertions.assertEquals("rhnj", model.prometheusUrl()); - Assertions.assertEquals(SslPreference.DISABLED, model.sslPreference()); - Assertions.assertEquals("v", model.sslCertificateUri()); - Assertions.assertEquals("ovqfzge", model.sapSid()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstanceListResultTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstanceListResultTests.java deleted file mode 100644 index 0179082c3e49..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstanceListResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.ProviderInstanceListResult; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ProviderInstanceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProviderInstanceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Accepted\"},\"id\":\"xogaokonzmnsikv\",\"name\":\"kqze\",\"type\":\"qkdltfz\"}],\"nextLink\":\"hhvh\"}") - .toObject(ProviderInstanceListResult.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("hhvh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderInstanceListResult model = - new ProviderInstanceListResult() - .withValue( - Arrays - .asList( - new ProviderInstanceInner() - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())))) - .withNextLink("hhvh"); - model = BinaryData.fromObject(model).toObject(ProviderInstanceListResult.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("hhvh", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteMockTests.java deleted file mode 100644 index b903268ad996..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderInstancesDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 ProviderInstancesDeleteMockTests { - @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 = - "{\"id\":\"xpxiwfcngjs\",\"name\":\"sii\",\"status\":\"tmkzjvkviirhgfgr\",\"percentComplete\":25.038736,\"startTime\":\"2021-05-20T10:14:07Z\",\"endTime\":\"2021-04-27T20:58:15Z\",\"operations\":[{\"id\":\"zb\",\"name\":\"byvi\",\"status\":\"tctbrxkjzwrgxffm\",\"percentComplete\":41.11345,\"startTime\":\"2021-08-28T12:30:32Z\",\"endTime\":\"2021-02-11T20:50:53Z\",\"operations\":[]},{\"id\":\"wopdbydpiz\",\"name\":\"clnapxbiygnugjkn\",\"status\":\"smfcttuxuuyilfl\",\"percentComplete\":45.98145,\"startTime\":\"2021-04-20T21:21:34Z\",\"endTime\":\"2021-06-20T10:05:15Z\",\"operations\":[]},{\"id\":\"njhvsujztc\",\"name\":\"tqjtwhauu\",\"status\":\"fprnjl\",\"percentComplete\":97.46975,\"startTime\":\"2021-02-18T12:39:05Z\",\"endTime\":\"2020-12-30T16:27:54Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.providerInstances().delete("gwflq", "mpizru", "n", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xpxiwfcngjs", response.id()); - Assertions.assertEquals("sii", response.name()); - Assertions.assertEquals("tmkzjvkviirhgfgr", response.status()); - Assertions.assertEquals(25.038736F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T10:14:07Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T20:58:15Z"), response.endTime()); - Assertions.assertEquals("zb", response.operations().get(0).id()); - Assertions.assertEquals("byvi", response.operations().get(0).name()); - Assertions.assertEquals("tctbrxkjzwrgxffm", response.operations().get(0).status()); - Assertions.assertEquals(41.11345F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T12:30:32Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T20:50:53Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderSpecificPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderSpecificPropertiesTests.java deleted file mode 100644 index f1079d01b7f0..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ProviderSpecificPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ProviderSpecificProperties; - -public final class ProviderSpecificPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProviderSpecificProperties model = - BinaryData - .fromString("{\"providerType\":\"ProviderSpecificProperties\"}") - .toObject(ProviderSpecificProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProviderSpecificProperties model = new ProviderSpecificProperties(); - model = BinaryData.fromObject(model).toObject(ProviderSpecificProperties.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapAvailabilityZoneDetailsWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapAvailabilityZoneDetailsWithResponseMockTests.java deleted file mode 100644 index e710b1b9d70d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapAvailabilityZoneDetailsWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; -import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsResult; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapProductType; -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 ResourceProvidersSapAvailabilityZoneDetailsWithResponseMockTests { - @Test - public void testSapAvailabilityZoneDetailsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"availabilityZonePairs\":[{\"zoneA\":6361635428329654747,\"zoneB\":7784785853201585272},{\"zoneA\":3454564679932943672,\"zoneB\":5824526456552081192},{\"zoneA\":6174770568857951171,\"zoneB\":6143780622017155787}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapAvailabilityZoneDetailsResult response = - manager - .resourceProviders() - .sapAvailabilityZoneDetailsWithResponse( - "emvvhm", - new SapAvailabilityZoneDetailsRequest() - .withAppLocation("tdrjfutacoebj") - .withSapProduct(SapProductType.OTHER) - .withDatabaseType(SapDatabaseType.DB2), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(6361635428329654747L, response.availabilityZonePairs().get(0).zoneA()); - Assertions.assertEquals(7784785853201585272L, response.availabilityZonePairs().get(0).zoneB()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapDiskConfigurationsWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapDiskConfigurationsWithResponseMockTests.java deleted file mode 100644 index 2995dd7a5ad9..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapDiskConfigurationsWithResponseMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; -import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsResult; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -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 ResourceProvidersSapDiskConfigurationsWithResponseMockTests { - @Test - public void testSapDiskConfigurationsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"volumeConfigurations\":{\"rbe\":{\"supportedConfigurations\":[]},\"o\":{\"supportedConfigurations\":[]},\"fkmr\":{\"supportedConfigurations\":[]}}}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapDiskConfigurationsResult response = - manager - .resourceProviders() - .sapDiskConfigurationsWithResponse( - "aryeu", - new SapDiskConfigurationsRequest() - .withAppLocation("yjkqabqgzslesjcb") - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.S4HANA) - .withDatabaseType(SapDatabaseType.HANA) - .withDeploymentType(SapDeploymentType.SINGLE_SERVER) - .withDbVmSku("tiewdj"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSizingRecommendationsWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSizingRecommendationsWithResponseMockTests.java deleted file mode 100644 index 969b57583a4c..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSizingRecommendationsWithResponseMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseScaleMethod; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; -import com.azure.resourcemanager.workloads.models.SapSizingRecommendationResult; -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 ResourceProvidersSapSizingRecommendationsWithResponseMockTests { - @Test - public void testSapSizingRecommendationsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"deploymentType\":\"SapSizingRecommendationResult\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapSizingRecommendationResult response = - manager - .resourceProviders() - .sapSizingRecommendationsWithResponse( - "dxeclzedqbcvh", - new SapSizingRecommendationRequest() - .withAppLocation("lhpl") - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.S4HANA) - .withDeploymentType(SapDeploymentType.SINGLE_SERVER) - .withSaps(4899977279662435855L) - .withDbMemory(6839901350584080017L) - .withDatabaseType(SapDatabaseType.DB2) - .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSupportedSkuWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSupportedSkuWithResponseMockTests.java deleted file mode 100644 index ba004c695a36..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ResourceProvidersSapSupportedSkuWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapSupportedResourceSkusResult; -import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; -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 ResourceProvidersSapSupportedSkuWithResponseMockTests { - @Test - public void testSapSupportedSkuWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"supportedSkus\":[{\"vmSku\":\"ezbrhubskh\",\"isAppServerCertified\":false,\"isDatabaseCertified\":false},{\"vmSku\":\"okkqfqjbvleo\",\"isAppServerCertified\":false,\"isDatabaseCertified\":true},{\"vmSku\":\"qtqzfavyv\",\"isAppServerCertified\":true,\"isDatabaseCertified\":false}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapSupportedResourceSkusResult response = - manager - .resourceProviders() - .sapSupportedSkuWithResponse( - "lkxt", - new SapSupportedSkusRequest() - .withAppLocation("qjfsmlmbtxhw") - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.ECC) - .withDeploymentType(SapDeploymentType.THREE_TIER) - .withDatabaseType(SapDatabaseType.DB2) - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ezbrhubskh", response.supportedSkus().get(0).vmSku()); - Assertions.assertEquals(false, response.supportedSkus().get(0).isAppServerCertified()); - Assertions.assertEquals(false, response.supportedSkus().get(0).isDatabaseCertified()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceInnerTests.java deleted file mode 100644 index dd20529ae346..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapApplicationServerInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapApplicationServerInstanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"instanceNo\":\"gmgsxnkjzkde\",\"subnet\":\"pvlopwiyighxpkd\",\"hostname\":\"baiuebbaumny\",\"kernelVersion\":\"ped\",\"kernelPatch\":\"jn\",\"ipAddress\":\"ckhsmtxpsieb\",\"gatewayPort\":4922743900723589322,\"icmHttpPort\":3953779484897603289,\"icmHttpsPort\":8344746335940164882,\"loadBalancerDetails\":{\"id\":\"dqmh\"},\"vmDetails\":[{\"type\":\"Unknown\",\"virtualMachineId\":\"dwkyzxuu\",\"storageDetails\":[]},{\"type\":\"Active\",\"virtualMachineId\":\"scwsv\",\"storageDetails\":[]},{\"type\":\"Active\",\"virtualMachineId\":\"g\",\"storageDetails\":[]}],\"status\":\"Offline\",\"health\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"errors\":{}},\"location\":\"i\",\"tags\":{\"vei\":\"vce\",\"dhbt\":\"ovnotyfjfcnjbkcn\",\"nermcl\":\"kphywpnvjto\",\"uscrpabgyepsb\":\"plpho\"},\"id\":\"tazqugxywpmueefj\",\"name\":\"wfqkquj\",\"type\":\"dsuyonobgla\"}") - .toObject(SapApplicationServerInstanceInner.class); - Assertions.assertEquals("i", model.location()); - Assertions.assertEquals("vce", model.tags().get("vei")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapApplicationServerInstanceInner model = - new SapApplicationServerInstanceInner() - .withLocation("i") - .withTags( - mapOf("vei", "vce", "dhbt", "ovnotyfjfcnjbkcn", "nermcl", "kphywpnvjto", "uscrpabgyepsb", "plpho")); - model = BinaryData.fromObject(model).toObject(SapApplicationServerInstanceInner.class); - Assertions.assertEquals("i", model.location()); - Assertions.assertEquals("vce", model.tags().get("vei")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceListTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceListTests.java deleted file mode 100644 index 6ba052d04ee0..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstanceListTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; -import com.azure.resourcemanager.workloads.models.SapApplicationServerInstanceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapApplicationServerInstanceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapApplicationServerInstanceList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"instanceNo\":\"ojgjrwjueiotwmc\",\"subnet\":\"tdx\",\"hostname\":\"txnrjaw\",\"kernelVersion\":\"wgxhn\",\"kernelPatch\":\"kxfbkpycgklwndn\",\"ipAddress\":\"dauwhvylwzbtd\",\"gatewayPort\":4861537181982868149,\"icmHttpPort\":3747533921605268466,\"icmHttpsPort\":3229287439431688526,\"vmDetails\":[],\"status\":\"Offline\",\"health\":\"Degraded\",\"provisioningState\":\"Failed\"},\"location\":\"ualupjmkh\",\"tags\":{\"lrbpbewtghfgbl\":\"bbcswsrtjri\"},\"id\":\"gw\",\"name\":\"zvlvqhjkbegib\",\"type\":\"nmxiebwwaloayqc\"}],\"nextLink\":\"rtzju\"}") - .toObject(SapApplicationServerInstanceList.class); - Assertions.assertEquals("ualupjmkh", model.value().get(0).location()); - Assertions.assertEquals("bbcswsrtjri", model.value().get(0).tags().get("lrbpbewtghfgbl")); - Assertions.assertEquals("rtzju", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapApplicationServerInstanceList model = - new SapApplicationServerInstanceList() - .withValue( - Arrays - .asList( - new SapApplicationServerInstanceInner() - .withLocation("ualupjmkh") - .withTags(mapOf("lrbpbewtghfgbl", "bbcswsrtjri")))) - .withNextLink("rtzju"); - model = BinaryData.fromObject(model).toObject(SapApplicationServerInstanceList.class); - Assertions.assertEquals("ualupjmkh", model.value().get(0).location()); - Assertions.assertEquals("bbcswsrtjri", model.value().get(0).tags().get("lrbpbewtghfgbl")); - Assertions.assertEquals("rtzju", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateMockTests.java deleted file mode 100644 index 9cabdeca57db..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SapApplicationServerInstancesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"instanceNo\":\"wcobie\",\"subnet\":\"tmninw\",\"hostname\":\"zcilnghg\",\"kernelVersion\":\"ejjtbxqmul\",\"kernelPatch\":\"lxqzvn\",\"ipAddress\":\"sbycucrwnamikz\",\"gatewayPort\":1725483024927981139,\"icmHttpPort\":3252438714549406945,\"icmHttpsPort\":4275672432001300092,\"loadBalancerDetails\":{\"id\":\"gfuhokzrusw\"},\"vmDetails\":[],\"status\":\"Running\",\"health\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"errors\":{}},\"location\":\"jsxjwwix\",\"tags\":{\"ehaohdjhh\":\"mwmxqhndvnoamld\",\"coxpelnjeta\":\"lzok\",\"g\":\"ltsxoatf\"},\"id\":\"pnpbswveflocc\",\"name\":\"rmozihmipgawt\",\"type\":\"xp\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapApplicationServerInstance response = - manager - .sapApplicationServerInstances() - .define("xjwet") - .withRegion("epttaqu") - .withExistingSapVirtualInstance("elfwy", "wl") - .withTags(mapOf("gehkfkimrtixokff", "wemxswvruunzz", "qwhix", "yinljqe")) - .create(); - - Assertions.assertEquals("jsxjwwix", response.location()); - Assertions.assertEquals("mwmxqhndvnoamld", response.tags().get("ehaohdjhh")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteMockTests.java deleted file mode 100644 index 1c2bfb28ea48..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapApplicationServerInstancesDeleteMockTests { - @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 = - "{\"id\":\"zdix\",\"name\":\"q\",\"status\":\"noda\",\"percentComplete\":23.312204,\"startTime\":\"2021-04-29T16:57Z\",\"endTime\":\"2021-07-22T14:39:18Z\",\"operations\":[{\"id\":\"mcgsbostzelnd\",\"name\":\"tutmzl\",\"status\":\"iojlvfhrb\",\"percentComplete\":77.28329,\"startTime\":\"2021-04-01T11:17:50Z\",\"endTime\":\"2021-10-25T03:38:05Z\",\"operations\":[]},{\"id\":\"urmochpprprs\",\"name\":\"okayzejnhlbkp\",\"status\":\"z\",\"percentComplete\":69.94925,\"startTime\":\"2021-03-27T09:58:50Z\",\"endTime\":\"2021-04-20T17:46:55Z\",\"operations\":[]},{\"id\":\"echndbnwieholew\",\"name\":\"iuubwefqsf\",\"status\":\"paq\",\"percentComplete\":4.0879908,\"startTime\":\"2021-11-03T02:23:27Z\",\"endTime\":\"2021-03-29T04:36:42Z\",\"operations\":[]},{\"id\":\"mfxapjwogqqno\",\"name\":\"udcdabtqwpwyawb\",\"status\":\"asqbucljgkyex\",\"percentComplete\":32.435863,\"startTime\":\"2021-10-16T00:16:04Z\",\"endTime\":\"2021-04-03T20:50:10Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.sapApplicationServerInstances().delete("q", "bkwvzg", "zvd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zdix", response.id()); - Assertions.assertEquals("q", response.name()); - Assertions.assertEquals("noda", response.status()); - Assertions.assertEquals(23.312204F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-29T16:57Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T14:39:18Z"), response.endTime()); - Assertions.assertEquals("mcgsbostzelnd", response.operations().get(0).id()); - Assertions.assertEquals("tutmzl", response.operations().get(0).name()); - Assertions.assertEquals("iojlvfhrb", response.operations().get(0).status()); - Assertions.assertEquals(77.28329F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-01T11:17:50Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T03:38:05Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetWithResponseMockTests.java deleted file mode 100644 index 942ffe34f4ce..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; -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 SapApplicationServerInstancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"instanceNo\":\"ftpmdtzfjltfv\",\"subnet\":\"cyjtotpvop\",\"hostname\":\"bdb\",\"kernelVersion\":\"gqqihedsvqwt\",\"kernelPatch\":\"ky\",\"ipAddress\":\"cysihs\",\"gatewayPort\":2251416135088020925,\"icmHttpPort\":5483811337729194379,\"icmHttpsPort\":8229457154745715233,\"loadBalancerDetails\":{\"id\":\"cdzsu\"},\"vmDetails\":[],\"status\":\"PartiallyRunning\",\"health\":\"Healthy\",\"provisioningState\":\"Updating\",\"errors\":{}},\"location\":\"uapcvhdbevwqqxe\",\"tags\":{\"eqocljmygvk\":\"onqzinkfkbgbzbow\"},\"id\":\"qkjjeokbz\",\"name\":\"fezrx\",\"type\":\"czurtlei\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapApplicationServerInstance response = - manager - .sapApplicationServerInstances() - .getWithResponse("xhugcm", "k", "vlgo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uapcvhdbevwqqxe", response.location()); - Assertions.assertEquals("onqzinkfkbgbzbow", response.tags().get("eqocljmygvk")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListMockTests.java deleted file mode 100644 index 973399deaa34..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; -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 SapApplicationServerInstancesListMockTests { - @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\":[{\"properties\":{\"instanceNo\":\"wgnyfusfzsvtui\",\"subnet\":\"hajqglcfh\",\"hostname\":\"rqryxynqn\",\"kernelVersion\":\"dpsovwxznptgo\",\"kernelPatch\":\"ybbabpfhvfsl\",\"ipAddress\":\"ntjlr\",\"gatewayPort\":6781686946100316558,\"icmHttpPort\":2304330923879655449,\"icmHttpsPort\":5753806140523602225,\"loadBalancerDetails\":{\"id\":\"zid\"},\"vmDetails\":[],\"status\":\"Running\",\"health\":\"Unknown\",\"provisioningState\":\"Failed\",\"errors\":{}},\"location\":\"gznmmaxrizkzob\",\"tags\":{\"ieixynllxe\":\"xlhslnel\"},\"id\":\"wcrojphslhcaw\",\"name\":\"u\",\"type\":\"i\"}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .sapApplicationServerInstances() - .list("daultxijjumfq", "azlnqnmcjngzqdqx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gznmmaxrizkzob", response.iterator().next().location()); - Assertions.assertEquals("xlhslnel", response.iterator().next().tags().get("ieixynllxe")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceMockTests.java deleted file mode 100644 index 664296b61d24..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStartInstanceMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapApplicationServerInstancesStartInstanceMockTests { - @Test - public void testStartInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"ujeickp\",\"name\":\"cpopmxel\",\"status\":\"wcltyjede\",\"percentComplete\":37.86498,\"startTime\":\"2021-04-24T06:30:07Z\",\"endTime\":\"2021-01-08T06:47:42Z\",\"operations\":[{\"id\":\"azuawx\",\"name\":\"x\",\"status\":\"uamwabzxrvxc\",\"percentComplete\":72.97776,\"startTime\":\"2021-05-14T08:17:22Z\",\"endTime\":\"2021-07-14T13:30:43Z\",\"operations\":[]},{\"id\":\"yasflvgsgzwy\",\"name\":\"koih\",\"status\":\"nsmjbl\",\"percentComplete\":81.84245,\"startTime\":\"2021-03-04T19:37:05Z\",\"endTime\":\"2021-08-20T09:09:27Z\",\"operations\":[]},{\"id\":\"qyryuzcbmqqvxm\",\"name\":\"fgtayxonsup\",\"status\":\"ujlzqnhcvsqltn\",\"percentComplete\":15.481228,\"startTime\":\"2021-05-02T00:04:59Z\",\"endTime\":\"2020-12-29T06:07:24Z\",\"operations\":[]},{\"id\":\"yqo\",\"name\":\"p\",\"status\":\"ox\",\"percentComplete\":4.6153727,\"startTime\":\"2021-07-30T17:53:09Z\",\"endTime\":\"2021-04-15T20:45:57Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapApplicationServerInstances() - .startInstance("dwfmvigorqjb", "tzh", "aglkafhon", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ujeickp", response.id()); - Assertions.assertEquals("cpopmxel", response.name()); - Assertions.assertEquals("wcltyjede", response.status()); - Assertions.assertEquals(37.86498F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T06:30:07Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T06:47:42Z"), response.endTime()); - Assertions.assertEquals("azuawx", response.operations().get(0).id()); - Assertions.assertEquals("x", response.operations().get(0).name()); - Assertions.assertEquals("uamwabzxrvxc", response.operations().get(0).status()); - Assertions.assertEquals(72.97776F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T08:17:22Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T13:30:43Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceMockTests.java deleted file mode 100644 index ed48d43b422f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesStopInstanceMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.OperationStatusResult; -import com.azure.resourcemanager.workloads.models.StopRequest; -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 SapApplicationServerInstancesStopInstanceMockTests { - @Test - public void testStopInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"embnkbw\",\"name\":\"vxkdivqihebwtswb\",\"status\":\"uwfmduragegizvc\",\"percentComplete\":48.271984,\"startTime\":\"2021-05-13T02:33:35Z\",\"endTime\":\"2021-06-18T15:42:06Z\",\"operations\":[{\"id\":\"ggbqi\",\"name\":\"xkbsazgakgac\",\"status\":\"rcmjdmspofapvuh\",\"percentComplete\":69.69709,\"startTime\":\"2021-10-23T00:02:47Z\",\"endTime\":\"2021-02-25T11:36:52Z\",\"operations\":[]},{\"id\":\"zjedmstkvnlv\",\"name\":\"c\",\"status\":\"iiznktwfan\",\"percentComplete\":4.799801,\"startTime\":\"2021-10-26T06:08:35Z\",\"endTime\":\"2021-05-05T18:43:08Z\",\"operations\":[]},{\"id\":\"stbz\",\"name\":\"iwbuqny\",\"status\":\"phzfylsgcrp\",\"percentComplete\":77.76872,\"startTime\":\"2021-03-23T07:29:02Z\",\"endTime\":\"2021-03-13T23:33:34Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapApplicationServerInstances() - .stopInstance( - "iiqbi", - "htmwwinh", - "hfqpofv", - new StopRequest().withSoftStopTimeoutSeconds(3058208759647015148L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("embnkbw", response.id()); - Assertions.assertEquals("vxkdivqihebwtswb", response.name()); - Assertions.assertEquals("uwfmduragegizvc", response.status()); - Assertions.assertEquals(48.271984F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-13T02:33:35Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T15:42:06Z"), response.endTime()); - Assertions.assertEquals("ggbqi", response.operations().get(0).id()); - Assertions.assertEquals("xkbsazgakgac", response.operations().get(0).name()); - Assertions.assertEquals("rcmjdmspofapvuh", response.operations().get(0).status()); - Assertions.assertEquals(69.69709F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:02:47Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T11:36:52Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsRequestTests.java deleted file mode 100644 index 5b3d474ae959..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsRequestTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import org.junit.jupiter.api.Assertions; - -public final class SapAvailabilityZoneDetailsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapAvailabilityZoneDetailsRequest model = - BinaryData - .fromString("{\"appLocation\":\"zufcyzkohdbi\",\"sapProduct\":\"Other\",\"databaseType\":\"HANA\"}") - .toObject(SapAvailabilityZoneDetailsRequest.class); - Assertions.assertEquals("zufcyzkohdbi", model.appLocation()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapAvailabilityZoneDetailsRequest model = - new SapAvailabilityZoneDetailsRequest() - .withAppLocation("zufcyzkohdbi") - .withSapProduct(SapProductType.OTHER) - .withDatabaseType(SapDatabaseType.HANA); - model = BinaryData.fromObject(model).toObject(SapAvailabilityZoneDetailsRequest.class); - Assertions.assertEquals("zufcyzkohdbi", model.appLocation()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsResultInnerTests.java deleted file mode 100644 index 5886c225d318..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZoneDetailsResultInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; -import com.azure.resourcemanager.workloads.models.SapAvailabilityZonePair; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapAvailabilityZoneDetailsResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapAvailabilityZoneDetailsResultInner model = - BinaryData - .fromString( - "{\"availabilityZonePairs\":[{\"zoneA\":7195819484478334007,\"zoneB\":9096749627848902766},{\"zoneA\":743485313874926492,\"zoneB\":1877152669215165811}]}") - .toObject(SapAvailabilityZoneDetailsResultInner.class); - Assertions.assertEquals(7195819484478334007L, model.availabilityZonePairs().get(0).zoneA()); - Assertions.assertEquals(9096749627848902766L, model.availabilityZonePairs().get(0).zoneB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapAvailabilityZoneDetailsResultInner model = - new SapAvailabilityZoneDetailsResultInner() - .withAvailabilityZonePairs( - Arrays - .asList( - new SapAvailabilityZonePair() - .withZoneA(7195819484478334007L) - .withZoneB(9096749627848902766L), - new SapAvailabilityZonePair() - .withZoneA(743485313874926492L) - .withZoneB(1877152669215165811L))); - model = BinaryData.fromObject(model).toObject(SapAvailabilityZoneDetailsResultInner.class); - Assertions.assertEquals(7195819484478334007L, model.availabilityZonePairs().get(0).zoneA()); - Assertions.assertEquals(9096749627848902766L, model.availabilityZonePairs().get(0).zoneB()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZonePairTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZonePairTests.java deleted file mode 100644 index 78e637e55108..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapAvailabilityZonePairTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapAvailabilityZonePair; -import org.junit.jupiter.api.Assertions; - -public final class SapAvailabilityZonePairTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapAvailabilityZonePair model = - BinaryData - .fromString("{\"zoneA\":5112949672295507633,\"zoneB\":2906295825403594883}") - .toObject(SapAvailabilityZonePair.class); - Assertions.assertEquals(5112949672295507633L, model.zoneA()); - Assertions.assertEquals(2906295825403594883L, model.zoneB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapAvailabilityZonePair model = - new SapAvailabilityZonePair().withZoneA(5112949672295507633L).withZoneB(2906295825403594883L); - model = BinaryData.fromObject(model).toObject(SapAvailabilityZonePair.class); - Assertions.assertEquals(5112949672295507633L, model.zoneA()); - Assertions.assertEquals(2906295825403594883L, model.zoneB()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstanceListTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstanceListTests.java deleted file mode 100644 index 23fb057274f4..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstanceListTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; -import com.azure.resourcemanager.workloads.models.SapCentralInstanceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapCentralInstanceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapCentralInstanceList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"instanceNo\":\"iywgqywgndrvynh\",\"subnet\":\"pphrcgynco\",\"kernelVersion\":\"m\",\"kernelPatch\":\"oo\",\"vmDetails\":[],\"status\":\"Stopping\",\"health\":\"Unknown\",\"provisioningState\":\"Deleting\"},\"location\":\"jqabcypmivkwlzuv\",\"tags\":{\"onlebxetqgtzxdpn\":\"wnfnbacf\",\"eallnwsubisnj\":\"bqqwxrj\"},\"id\":\"mpmngnzscxaqwoo\",\"name\":\"hcbonqvpkvlr\",\"type\":\"njeaseipheofloke\"},{\"properties\":{\"instanceNo\":\"enjbdlwtgrhp\",\"subnet\":\"pj\",\"kernelVersion\":\"zj\",\"kernelPatch\":\"yegu\",\"vmDetails\":[],\"status\":\"Offline\",\"health\":\"Healthy\",\"provisioningState\":\"Deleting\"},\"location\":\"zvdudgwdslfhotwm\",\"tags\":{\"cftadeh\":\"pwlbjnpg\",\"dejbavo\":\"nltyfsoppusuesnz\",\"vudwx\":\"xzdmohctb\"},\"id\":\"ndnvo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"properties\":{\"instanceNo\":\"qweykhmenev\",\"subnet\":\"exfwhy\",\"kernelVersion\":\"vdcsitynn\",\"kernelPatch\":\"mdectehfiqscjey\",\"vmDetails\":[],\"status\":\"Offline\",\"health\":\"Unhealthy\",\"provisioningState\":\"Failed\"},\"location\":\"jrefovgmkqsle\",\"tags\":{\"k\":\"xyqj\",\"jh\":\"attpngjcrcczsq\",\"ysou\":\"mdajv\",\"canoaeupf\":\"q\"},\"id\":\"yhltrpmopjmcm\",\"name\":\"tuo\",\"type\":\"thfuiuaodsfcpkvx\"},{\"properties\":{\"instanceNo\":\"uozmyzydagfua\",\"subnet\":\"ezyiuokktwhrdxw\",\"kernelVersion\":\"bsureximo\",\"kernelPatch\":\"ocfs\",\"vmDetails\":[],\"status\":\"Running\",\"health\":\"Degraded\",\"provisioningState\":\"Creating\"},\"location\":\"i\",\"tags\":{\"vyifqrvkdvjsl\":\"hqyudxorrqnbpoc\",\"vdfwatkpn\":\"rm\",\"wiqzbqjvsovmyo\":\"ulexxbczwtr\",\"zdobpxjmflbvvnch\":\"acspkwl\"},\"id\":\"kcciwwzjuqkhr\",\"name\":\"ajiwkuo\",\"type\":\"oskg\"}],\"nextLink\":\"auu\"}") - .toObject(SapCentralInstanceList.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.value().get(0).location()); - Assertions.assertEquals("wnfnbacf", model.value().get(0).tags().get("onlebxetqgtzxdpn")); - Assertions.assertEquals("auu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapCentralInstanceList model = - new SapCentralInstanceList() - .withValue( - Arrays - .asList( - new SapCentralServerInstanceInner() - .withLocation("jqabcypmivkwlzuv") - .withTags(mapOf("onlebxetqgtzxdpn", "wnfnbacf", "eallnwsubisnj", "bqqwxrj")), - new SapCentralServerInstanceInner() - .withLocation("zvdudgwdslfhotwm") - .withTags( - mapOf("cftadeh", "pwlbjnpg", "dejbavo", "nltyfsoppusuesnz", "vudwx", "xzdmohctb")), - new SapCentralServerInstanceInner() - .withLocation("jrefovgmkqsle") - .withTags( - mapOf("k", "xyqj", "jh", "attpngjcrcczsq", "ysou", "mdajv", "canoaeupf", "q")), - new SapCentralServerInstanceInner() - .withLocation("i") - .withTags( - mapOf( - "vyifqrvkdvjsl", - "hqyudxorrqnbpoc", - "vdfwatkpn", - "rm", - "wiqzbqjvsovmyo", - "ulexxbczwtr", - "zdobpxjmflbvvnch", - "acspkwl")))) - .withNextLink("auu"); - model = BinaryData.fromObject(model).toObject(SapCentralInstanceList.class); - Assertions.assertEquals("jqabcypmivkwlzuv", model.value().get(0).location()); - Assertions.assertEquals("wnfnbacf", model.value().get(0).tags().get("onlebxetqgtzxdpn")); - Assertions.assertEquals("auu", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateMockTests.java deleted file mode 100644 index 21f3ded4dc2a..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.EnqueueReplicationServerProperties; -import com.azure.resourcemanager.workloads.models.EnqueueServerProperties; -import com.azure.resourcemanager.workloads.models.GatewayServerProperties; -import com.azure.resourcemanager.workloads.models.MessageServerProperties; -import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SapCentralInstancesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"instanceNo\":\"lbj\",\"subnet\":\"nljlageuaulx\",\"messageServerProperties\":{\"msPort\":4644267611854169292,\"internalMsPort\":1025453690932299158,\"httpPort\":7293143912225340990,\"httpsPort\":3933133394775341003,\"hostname\":\"lsvxeizz\",\"ipAddress\":\"klnsrmffey\",\"health\":\"Unknown\"},\"enqueueServerProperties\":{\"hostname\":\"piymerteea\",\"ipAddress\":\"xqiekkkzddrtk\",\"port\":6820222826477981340,\"health\":\"Unhealthy\"},\"gatewayServerProperties\":{\"port\":162263939675431561,\"health\":\"Healthy\"},\"enqueueReplicationServerProperties\":{\"ersVersion\":\"EnqueueReplicator1\",\"instanceNo\":\"svecuijpxtxs\",\"hostname\":\"prtujwsawdd\",\"kernelVersion\":\"babxvitit\",\"kernelPatch\":\"zeexavoxtfgle\",\"ipAddress\":\"m\",\"health\":\"Degraded\"},\"kernelVersion\":\"pypqtgsfj\",\"kernelPatch\":\"b\",\"loadBalancerDetails\":{\"id\":\"hxudbxvodht\"},\"vmDetails\":[],\"status\":\"SoftShutdown\",\"health\":\"Healthy\",\"provisioningState\":\"Succeeded\",\"errors\":{}},\"location\":\"ckdlpag\",\"tags\":{\"a\":\"x\",\"xwmdboxd\":\"lc\",\"ckknhxkizvy\":\"gsftufqobrjlnacg\",\"nok\":\"nrzvuljraaer\"},\"id\":\"gukkjqnvbroy\",\"name\":\"a\",\"type\":\"xulcdisdos\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapCentralServerInstance response = - manager - .sapCentralInstances() - .define("tilaxh") - .withRegion("ah") - .withExistingSapVirtualInstance("yrpfoobrlttymsj", "ygqdnfwqzdz") - .withTags(mapOf("jhhn", "atjeaahh")) - .withMessageServerProperties(new MessageServerProperties()) - .withEnqueueServerProperties(new EnqueueServerProperties()) - .withGatewayServerProperties(new GatewayServerProperties()) - .withEnqueueReplicationServerProperties(new EnqueueReplicationServerProperties()) - .create(); - - Assertions.assertEquals("ckdlpag", response.location()); - Assertions.assertEquals("x", response.tags().get("a")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteMockTests.java deleted file mode 100644 index 36affb068238..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapCentralInstancesDeleteMockTests { - @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 = - "{\"id\":\"dyuib\",\"name\":\"fdn\",\"status\":\"zydvfvf\",\"percentComplete\":24.809902,\"startTime\":\"2021-04-11T21:14:02Z\",\"endTime\":\"2021-08-13T22:24:58Z\",\"operations\":[{\"id\":\"hmgorffukiscv\",\"name\":\"zhwplefaxvxilc\",\"status\":\"tg\",\"percentComplete\":56.04085,\"startTime\":\"2021-09-14T23:20:53Z\",\"endTime\":\"2021-09-18T20:37:44Z\",\"operations\":[]},{\"id\":\"fzqlqhycavod\",\"name\":\"xdbeesmieknl\",\"status\":\"ariaawi\",\"percentComplete\":7.9919996,\"startTime\":\"2021-06-12T21:06:16Z\",\"endTime\":\"2021-09-15T12:14:34Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.sapCentralInstances().delete("bunzozudh", "xg", "moy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dyuib", response.id()); - Assertions.assertEquals("fdn", response.name()); - Assertions.assertEquals("zydvfvf", response.status()); - Assertions.assertEquals(24.809902F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-11T21:14:02Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T22:24:58Z"), response.endTime()); - Assertions.assertEquals("hmgorffukiscv", response.operations().get(0).id()); - Assertions.assertEquals("zhwplefaxvxilc", response.operations().get(0).name()); - Assertions.assertEquals("tg", response.operations().get(0).status()); - Assertions.assertEquals(56.04085F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T23:20:53Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T20:37:44Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetWithResponseMockTests.java deleted file mode 100644 index 96382f041c4d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; -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 SapCentralInstancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"instanceNo\":\"b\",\"subnet\":\"qvkjlmxho\",\"messageServerProperties\":{\"msPort\":4997501643254233811,\"internalMsPort\":5593659060766409421,\"httpPort\":7830011600029821533,\"httpsPort\":8542607541741441378,\"hostname\":\"aauzzptjazysd\",\"ipAddress\":\"ezwwv\",\"health\":\"Unhealthy\"},\"enqueueServerProperties\":{\"hostname\":\"vv\",\"ipAddress\":\"nk\",\"port\":7483475078710435538,\"health\":\"Unhealthy\"},\"gatewayServerProperties\":{\"port\":650828533296238528,\"health\":\"Unknown\"},\"enqueueReplicationServerProperties\":{\"ersVersion\":\"EnqueueReplicator2\",\"instanceNo\":\"uwmncs\",\"hostname\":\"ijf\",\"kernelVersion\":\"vpo\",\"kernelPatch\":\"rsg\",\"ipAddress\":\"b\",\"health\":\"Degraded\"},\"kernelVersion\":\"qgnjdgkynscli\",\"kernelPatch\":\"zvhxnk\",\"loadBalancerDetails\":{\"id\":\"kubotppnvdxz\"},\"vmDetails\":[],\"status\":\"Running\",\"health\":\"Unknown\",\"provisioningState\":\"Updating\",\"errors\":{}},\"location\":\"agtltdhlfkqoj\",\"tags\":{\"ymbrnysuxmpraf\":\"vgtrdcnifmzzs\",\"khocxvdfffwaf\":\"g\"},\"id\":\"roud\",\"name\":\"spave\",\"type\":\"hrv\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapCentralServerInstance response = - manager - .sapCentralInstances() - .getWithResponse("iayz", "iykhy", "wf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("agtltdhlfkqoj", response.location()); - Assertions.assertEquals("vgtrdcnifmzzs", response.tags().get("ymbrnysuxmpraf")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListMockTests.java deleted file mode 100644 index 1a7adc1164cb..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; -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 SapCentralInstancesListMockTests { - @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\":[{\"properties\":{\"instanceNo\":\"ogfnzjvusf\",\"subnet\":\"dmozu\",\"messageServerProperties\":{\"msPort\":7577578253018507167,\"internalMsPort\":4531739800208315375,\"httpPort\":2038378510011319534,\"httpsPort\":866081564724906036,\"hostname\":\"nbtgkbugrjqctoj\",\"ipAddress\":\"isofieypefojyqd\",\"health\":\"Unknown\"},\"enqueueServerProperties\":{\"hostname\":\"cp\",\"ipAddress\":\"wkhihihlhzdsqt\",\"port\":85207592738444256,\"health\":\"Unknown\"},\"gatewayServerProperties\":{\"port\":7805991014076189664,\"health\":\"Degraded\"},\"enqueueReplicationServerProperties\":{\"ersVersion\":\"EnqueueReplicator1\",\"instanceNo\":\"cact\",\"hostname\":\"wotey\",\"kernelVersion\":\"cluqovekqvgqo\",\"kernelPatch\":\"ifzmpjwyivqi\",\"ipAddress\":\"xcvhrfs\",\"health\":\"Degraded\"},\"kernelVersion\":\"grttikteusqczk\",\"kernelPatch\":\"klxubyja\",\"loadBalancerDetails\":{\"id\":\"mfblcqcuubg\"},\"vmDetails\":[],\"status\":\"Offline\",\"health\":\"Degraded\",\"provisioningState\":\"Failed\",\"errors\":{}},\"location\":\"wgdsl\",\"tags\":{\"xiutcx\":\"hhrmooizqsey\",\"etoge\":\"pzhyr\"},\"id\":\"joxslhvnhla\",\"name\":\"rqnkkzjcjbtr\",\"type\":\"aehvvibrxjjstoq\"}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sapCentralInstances().list("yr", "giagtcojo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wgdsl", response.iterator().next().location()); - Assertions.assertEquals("hhrmooizqsey", response.iterator().next().tags().get("xiutcx")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceMockTests.java deleted file mode 100644 index 4a427c74a901..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStartInstanceMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapCentralInstancesStartInstanceMockTests { - @Test - public void testStartInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"h\",\"name\":\"uj\",\"status\":\"wtwko\",\"percentComplete\":47.507977,\"startTime\":\"2021-10-07T04:59:40Z\",\"endTime\":\"2021-06-28T03:01:15Z\",\"operations\":[{\"id\":\"pfajnjwltlwtjj\",\"name\":\"ktalhsnvkcdmxz\",\"status\":\"poaimlnwiaaomyl\",\"percentComplete\":22.20102,\"startTime\":\"2021-06-10T08:34:29Z\",\"endTime\":\"2021-11-05T00:05:37Z\",\"operations\":[]},{\"id\":\"wwnpj\",\"name\":\"fz\",\"status\":\"wpchwahf\",\"percentComplete\":69.62483,\"startTime\":\"2021-04-23T04:46:24Z\",\"endTime\":\"2021-10-20T07:30:59Z\",\"operations\":[]},{\"id\":\"wetwlyxgncxykxh\",\"name\":\"h\",\"status\":\"immbcx\",\"percentComplete\":95.871994,\"startTime\":\"2021-05-04T19:01:44Z\",\"endTime\":\"2021-08-24T02:48:56Z\",\"operations\":[]},{\"id\":\"jzh\",\"name\":\"zxfpxtgqsc\",\"status\":\"avft\",\"percentComplete\":76.74104,\"startTime\":\"2021-02-07T10:07:03Z\",\"endTime\":\"2021-06-22T03:40:10Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapCentralInstances() - .startInstance("eitpkxztmo", "bklftidgfcwqmpim", "qxzhem", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("h", response.id()); - Assertions.assertEquals("uj", response.name()); - Assertions.assertEquals("wtwko", response.status()); - Assertions.assertEquals(47.507977F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T04:59:40Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T03:01:15Z"), response.endTime()); - Assertions.assertEquals("pfajnjwltlwtjj", response.operations().get(0).id()); - Assertions.assertEquals("ktalhsnvkcdmxz", response.operations().get(0).name()); - Assertions.assertEquals("poaimlnwiaaomyl", response.operations().get(0).status()); - Assertions.assertEquals(22.20102F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T08:34:29Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T00:05:37Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceMockTests.java deleted file mode 100644 index ddbee77df5c0..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesStopInstanceMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.OperationStatusResult; -import com.azure.resourcemanager.workloads.models.StopRequest; -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 SapCentralInstancesStopInstanceMockTests { - @Test - public void testStopInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"wrxgkneuvy\",\"name\":\"zqodfvpgshox\",\"status\":\"sgbpfgzdjtx\",\"percentComplete\":47.279125,\"startTime\":\"2021-11-10T23:35:43Z\",\"endTime\":\"2021-06-22T13:04:58Z\",\"operations\":[{\"id\":\"vl\",\"name\":\"fcq\",\"status\":\"srdvetn\",\"percentComplete\":52.092457,\"startTime\":\"2021-07-31T00:34:25Z\",\"endTime\":\"2021-10-25T02:19:11Z\",\"operations\":[]},{\"id\":\"ycvuzhyrmewipmv\",\"name\":\"dxukuqgsjjxundxg\",\"status\":\"etw\",\"percentComplete\":28.554367,\"startTime\":\"2021-01-23T07:38:45Z\",\"endTime\":\"2021-06-23T07:46:43Z\",\"operations\":[]},{\"id\":\"vmuvgpmu\",\"name\":\"qsxvmhf\",\"status\":\"uzjyihsasbhudypo\",\"percentComplete\":36.771446,\"startTime\":\"2021-02-10T03:41:38Z\",\"endTime\":\"2021-12-09T13:14:50Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapCentralInstances() - .stopInstance( - "guwpi", - "r", - "jcivmmg", - new StopRequest().withSoftStopTimeoutSeconds(1865128114829410561L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wrxgkneuvy", response.id()); - Assertions.assertEquals("zqodfvpgshox", response.name()); - Assertions.assertEquals("sgbpfgzdjtx", response.status()); - Assertions.assertEquals(47.279125F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T23:35:43Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T13:04:58Z"), response.endTime()); - Assertions.assertEquals("vl", response.operations().get(0).id()); - Assertions.assertEquals("fcq", response.operations().get(0).name()); - Assertions.assertEquals("srdvetn", response.operations().get(0).status()); - Assertions.assertEquals(52.092457F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T00:34:25Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T02:19:11Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralServerInstanceInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralServerInstanceInnerTests.java deleted file mode 100644 index f2f4aaf3d657..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapCentralServerInstanceInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; -import com.azure.resourcemanager.workloads.models.EnqueueReplicationServerProperties; -import com.azure.resourcemanager.workloads.models.EnqueueServerProperties; -import com.azure.resourcemanager.workloads.models.GatewayServerProperties; -import com.azure.resourcemanager.workloads.models.MessageServerProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapCentralServerInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapCentralServerInstanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"instanceNo\":\"pbkwtmu\",\"subnet\":\"uqktap\",\"messageServerProperties\":{\"msPort\":3469094564596058624,\"internalMsPort\":8788787487119188648,\"httpPort\":5085835917600063324,\"httpsPort\":7897278653566127978,\"hostname\":\"vqwhbmdgbbjfd\",\"ipAddress\":\"mbmbexppbh\",\"health\":\"Healthy\"},\"enqueueServerProperties\":{\"hostname\":\"lfp\",\"ipAddress\":\"s\",\"port\":9219502024356576033,\"health\":\"Unknown\"},\"gatewayServerProperties\":{\"port\":8329500561885071597,\"health\":\"Unhealthy\"},\"enqueueReplicationServerProperties\":{\"ersVersion\":\"EnqueueReplicator2\",\"instanceNo\":\"o\",\"hostname\":\"hr\",\"kernelVersion\":\"ilnerkujysvlejuv\",\"kernelPatch\":\"awrlyx\",\"ipAddress\":\"kcprbnw\",\"health\":\"Healthy\"},\"kernelVersion\":\"vtb\",\"kernelPatch\":\"ysszdnrujqguh\",\"loadBalancerDetails\":{\"id\":\"uqfprwzw\"},\"vmDetails\":[{\"type\":\"Unknown\",\"virtualMachineId\":\"nwui\",\"storageDetails\":[]}],\"status\":\"Stopping\",\"health\":\"Unhealthy\",\"provisioningState\":\"Failed\",\"errors\":{}},\"location\":\"kyfi\",\"tags\":{\"zwdzuh\":\"idf\",\"wxmnteiwao\":\"ymwisdkft\"},\"id\":\"vkmijcmmxdcuf\",\"name\":\"fsrpymzidnse\",\"type\":\"cxtbzsg\"}") - .toObject(SapCentralServerInstanceInner.class); - Assertions.assertEquals("kyfi", model.location()); - Assertions.assertEquals("idf", model.tags().get("zwdzuh")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapCentralServerInstanceInner model = - new SapCentralServerInstanceInner() - .withLocation("kyfi") - .withTags(mapOf("zwdzuh", "idf", "wxmnteiwao", "ymwisdkft")) - .withMessageServerProperties(new MessageServerProperties()) - .withEnqueueServerProperties(new EnqueueServerProperties()) - .withGatewayServerProperties(new GatewayServerProperties()) - .withEnqueueReplicationServerProperties(new EnqueueReplicationServerProperties()); - model = BinaryData.fromObject(model).toObject(SapCentralServerInstanceInner.class); - Assertions.assertEquals("kyfi", model.location()); - Assertions.assertEquals("idf", model.tags().get("zwdzuh")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapConfigurationTests.java deleted file mode 100644 index 18d2f58b9fe5..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapConfiguration; - -public final class SapConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapConfiguration model = - BinaryData.fromString("{\"configurationType\":\"SapConfiguration\"}").toObject(SapConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapConfiguration model = new SapConfiguration(); - model = BinaryData.fromObject(model).toObject(SapConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceInnerTests.java deleted file mode 100644 index b6e82d736975..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapDatabaseInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapDatabaseInstanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"subnet\":\"mvxi\",\"databaseSid\":\"uugidyjrrfby\",\"databaseType\":\"svexcsonpclhoco\",\"ipAddress\":\"lkevle\",\"loadBalancerDetails\":{\"id\":\"fbuhfmvfaxkffe\"},\"vmDetails\":[{\"virtualMachineId\":\"lvmezyvshxmzsbbz\",\"status\":\"Stopping\",\"storageDetails\":[]}],\"status\":\"PartiallyRunning\",\"provisioningState\":\"Updating\",\"errors\":{}},\"location\":\"vjxxjnsp\",\"tags\":{\"nkoukn\":\"tko\",\"ngkpocipazy\":\"udwtiukbl\",\"gukgjnpiucgygevq\":\"o\"},\"id\":\"ntypmrbpizcdrqj\",\"name\":\"dpydn\",\"type\":\"yhxdeoejzicwi\"}") - .toObject(SapDatabaseInstanceInner.class); - Assertions.assertEquals("vjxxjnsp", model.location()); - Assertions.assertEquals("tko", model.tags().get("nkoukn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapDatabaseInstanceInner model = - new SapDatabaseInstanceInner() - .withLocation("vjxxjnsp") - .withTags(mapOf("nkoukn", "tko", "ngkpocipazy", "udwtiukbl", "gukgjnpiucgygevq", "o")); - model = BinaryData.fromObject(model).toObject(SapDatabaseInstanceInner.class); - Assertions.assertEquals("vjxxjnsp", model.location()); - Assertions.assertEquals("tko", model.tags().get("nkoukn")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceListTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceListTests.java deleted file mode 100644 index a79acd46556d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstanceListTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; -import com.azure.resourcemanager.workloads.models.SapDatabaseInstanceList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapDatabaseInstanceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapDatabaseInstanceList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"subnet\":\"hkaetcktvfc\",\"databaseSid\":\"fsnkymuctq\",\"databaseType\":\"fbebrjcxer\",\"ipAddress\":\"wutttxfvjrbi\",\"vmDetails\":[],\"status\":\"Running\",\"provisioningState\":\"Failed\"},\"location\":\"ahfn\",\"tags\":{\"j\":\"yq\",\"gvcl\":\"uujqgidokgjljyo\",\"jhtxfvgxbfsmxne\":\"bgsncghkjeszzhb\",\"rbmpukgri\":\"mpvecxgodebfqk\"},\"id\":\"flz\",\"name\":\"fbxzpuzycisp\",\"type\":\"qzahmgkbrp\"},{\"properties\":{\"subnet\":\"hibnuqqkpika\",\"databaseSid\":\"gvtqagnbuynh\",\"databaseType\":\"gg\",\"ipAddress\":\"bfs\",\"vmDetails\":[],\"status\":\"Running\",\"provisioningState\":\"Creating\"},\"location\":\"pnazzm\",\"tags\":{\"hrbnlankxmyskpbh\":\"unmpxttd\",\"yn\":\"nbtkcxywnytnr\"},\"id\":\"qidybyx\",\"name\":\"zfcl\",\"type\":\"aaxdbabphlwrq\"},{\"properties\":{\"subnet\":\"tsthsucocm\",\"databaseSid\":\"yazttbtwwrqpue\",\"databaseType\":\"kzywbiex\",\"ipAddress\":\"eyueaxibxujwb\",\"vmDetails\":[],\"status\":\"Starting\",\"provisioningState\":\"Updating\"},\"location\":\"oxaepd\",\"tags\":{\"bavxbniwdjswzt\":\"ancuxrhd\",\"xbzpfzab\":\"dbpgnxytxhp\"},\"id\":\"lcuhxwtctyqiklb\",\"name\":\"ovplw\",\"type\":\"bhvgy\"}],\"nextLink\":\"uosvmkfssxqukk\"}") - .toObject(SapDatabaseInstanceList.class); - Assertions.assertEquals("ahfn", model.value().get(0).location()); - Assertions.assertEquals("yq", model.value().get(0).tags().get("j")); - Assertions.assertEquals("uosvmkfssxqukk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapDatabaseInstanceList model = - new SapDatabaseInstanceList() - .withValue( - Arrays - .asList( - new SapDatabaseInstanceInner() - .withLocation("ahfn") - .withTags( - mapOf( - "j", - "yq", - "gvcl", - "uujqgidokgjljyo", - "jhtxfvgxbfsmxne", - "bgsncghkjeszzhb", - "rbmpukgri", - "mpvecxgodebfqk")), - new SapDatabaseInstanceInner() - .withLocation("pnazzm") - .withTags(mapOf("hrbnlankxmyskpbh", "unmpxttd", "yn", "nbtkcxywnytnr")), - new SapDatabaseInstanceInner() - .withLocation("oxaepd") - .withTags(mapOf("bavxbniwdjswzt", "ancuxrhd", "xbzpfzab", "dbpgnxytxhp")))) - .withNextLink("uosvmkfssxqukk"); - model = BinaryData.fromObject(model).toObject(SapDatabaseInstanceList.class); - Assertions.assertEquals("ahfn", model.value().get(0).location()); - Assertions.assertEquals("yq", model.value().get(0).tags().get("j")); - Assertions.assertEquals("uosvmkfssxqukk", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateMockTests.java deleted file mode 100644 index d4479449d276..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SapDatabaseInstancesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"subnet\":\"vbmqzbqq\",\"databaseSid\":\"aj\",\"databaseType\":\"wxacevehj\",\"ipAddress\":\"yxoaf\",\"loadBalancerDetails\":{\"id\":\"qltfaey\"},\"vmDetails\":[],\"status\":\"Starting\",\"provisioningState\":\"Succeeded\",\"errors\":{}},\"location\":\"pghriypoqeyhl\",\"tags\":{\"qdsmexiit\":\"kprlpyznuc\",\"stgnl\":\"fuxtyasiibmiybnn\",\"vmqfoud\":\"hnmgixhcm\"},\"id\":\"rhc\",\"name\":\"yyprotwyp\",\"type\":\"ndm\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapDatabaseInstance response = - manager - .sapDatabaseInstances() - .define("fuojrngif") - .withRegion("phojeevyhy") - .withExistingSapVirtualInstance("ouau", "rjtloq") - .withTags(mapOf("mfg", "zfczbg")) - .create(); - - Assertions.assertEquals("pghriypoqeyhl", response.location()); - Assertions.assertEquals("kprlpyznuc", response.tags().get("qdsmexiit")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteMockTests.java deleted file mode 100644 index 4e6cda87749a..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapDatabaseInstancesDeleteMockTests { - @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 = - "{\"id\":\"lllibph\",\"name\":\"zmizakakan\",\"status\":\"jpdn\",\"percentComplete\":9.865725,\"startTime\":\"2021-03-02T00:11:10Z\",\"endTime\":\"2021-05-28T06:55:36Z\",\"operations\":[{\"id\":\"lmuoyxprimrsopte\",\"name\":\"jme\",\"status\":\"slstvasy\",\"percentComplete\":20.932108,\"startTime\":\"2021-03-08T01:37:13Z\",\"endTime\":\"2021-01-12T02:29:32Z\",\"operations\":[]},{\"id\":\"hguuf\",\"name\":\"boyjathwt\",\"status\":\"olbaemwmdx\",\"percentComplete\":92.43111,\"startTime\":\"2021-09-30T09:00:56Z\",\"endTime\":\"2021-10-19T05:13Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.sapDatabaseInstances().delete("qtgdqohmcwsl", "riz", "tpwb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lllibph", response.id()); - Assertions.assertEquals("zmizakakan", response.name()); - Assertions.assertEquals("jpdn", response.status()); - Assertions.assertEquals(9.865725F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-02T00:11:10Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T06:55:36Z"), response.endTime()); - Assertions.assertEquals("lmuoyxprimrsopte", response.operations().get(0).id()); - Assertions.assertEquals("jme", response.operations().get(0).name()); - Assertions.assertEquals("slstvasy", response.operations().get(0).status()); - Assertions.assertEquals(20.932108F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T01:37:13Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T02:29:32Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetWithResponseMockTests.java deleted file mode 100644 index 0b29f4a19e96..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; -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 SapDatabaseInstancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"subnet\":\"vpdvjdhttzae\",\"databaseSid\":\"dxihc\",\"databaseType\":\"phkmcrjdqnsdfz\",\"ipAddress\":\"gtgkylkdghr\",\"loadBalancerDetails\":{\"id\":\"utlwxezwzhok\"},\"vmDetails\":[],\"status\":\"Unavailable\",\"provisioningState\":\"Deleting\",\"errors\":{}},\"location\":\"ehgpp\",\"tags\":{\"csheafidltugsr\":\"fhpfeoajvgcxtx\",\"h\":\"smkss\"},\"id\":\"iftxfkf\",\"name\":\"egprhptil\",\"type\":\"ucb\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapDatabaseInstance response = - manager - .sapDatabaseInstances() - .getWithResponse("jbjsvgjrwh", "yvycytdclxgcckn", "nwm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ehgpp", response.location()); - Assertions.assertEquals("fhpfeoajvgcxtx", response.tags().get("csheafidltugsr")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListMockTests.java deleted file mode 100644 index 6ceeb40c4e22..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; -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 SapDatabaseInstancesListMockTests { - @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\":[{\"properties\":{\"subnet\":\"ddtvqctt\",\"databaseSid\":\"ijaeukm\",\"databaseType\":\"ieekpndzaa\",\"ipAddress\":\"udqmeqwigpibudq\",\"loadBalancerDetails\":{\"id\":\"eb\"},\"vmDetails\":[],\"status\":\"Stopping\",\"provisioningState\":\"Creating\",\"errors\":{}},\"location\":\"ff\",\"tags\":{\"qaqhvseufu\":\"itmhhei\",\"smjqfrddgam\":\"yrxpdlcgqls\",\"vfcdisyirn\":\"uhiosrsju\",\"vwrevkhgnlnzon\":\"zhczexrxzbujrtrh\"},\"id\":\"lrpiqywnc\",\"name\":\"jtszcof\",\"type\":\"zehtdhgb\"}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sapDatabaseInstances().list("lxveabfqx", "mwmqtibx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ff", response.iterator().next().location()); - Assertions.assertEquals("itmhhei", response.iterator().next().tags().get("qaqhvseufu")); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceMockTests.java deleted file mode 100644 index 8c832119e5d5..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStartInstanceMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapDatabaseInstancesStartInstanceMockTests { - @Test - public void testStartInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"lpmjerb\",\"name\":\"elvidizozsdbccx\",\"status\":\"monfdgnwncypuuww\",\"percentComplete\":0.8582592,\"startTime\":\"2021-11-20T18:00Z\",\"endTime\":\"2021-02-10T14:17:27Z\",\"operations\":[{\"id\":\"nkeifz\",\"name\":\"mkdasv\",\"status\":\"lyhb\",\"percentComplete\":95.53096,\"startTime\":\"2021-01-15T10:18:43Z\",\"endTime\":\"2021-12-10T05:26:35Z\",\"operations\":[]},{\"id\":\"oldforobw\",\"name\":\"vizbfhfo\",\"status\":\"vacqpbtuodxesz\",\"percentComplete\":87.85364,\"startTime\":\"2021-07-01T15:33:02Z\",\"endTime\":\"2021-08-31T22:37:44Z\",\"operations\":[]},{\"id\":\"slzkwrrwoycqu\",\"name\":\"yhahnomdrkyw\",\"status\":\"hpsvfu\",\"percentComplete\":58.89424,\"startTime\":\"2021-08-15T09:05:35Z\",\"endTime\":\"2021-11-04T07:23:46Z\",\"operations\":[]},{\"id\":\"alniexzsrzp\",\"name\":\"pqtybb\",\"status\":\"wpgdak\",\"percentComplete\":27.999931,\"startTime\":\"2021-03-31T06:49:58Z\",\"endTime\":\"2021-04-07T03:58:53Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapDatabaseInstances() - .startInstance("k", "reljeamur", "zmlovuanash", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lpmjerb", response.id()); - Assertions.assertEquals("elvidizozsdbccx", response.name()); - Assertions.assertEquals("monfdgnwncypuuww", response.status()); - Assertions.assertEquals(0.8582592F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T18:00Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T14:17:27Z"), response.endTime()); - Assertions.assertEquals("nkeifz", response.operations().get(0).id()); - Assertions.assertEquals("mkdasv", response.operations().get(0).name()); - Assertions.assertEquals("lyhb", response.operations().get(0).status()); - Assertions.assertEquals(95.53096F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-15T10:18:43Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T05:26:35Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceMockTests.java deleted file mode 100644 index 5b1d3be3d0ee..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesStopInstanceMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.OperationStatusResult; -import com.azure.resourcemanager.workloads.models.StopRequest; -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 SapDatabaseInstancesStopInstanceMockTests { - @Test - public void testStopInstance() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"ntvlwijpsttexo\",\"name\":\"pwcyyufmhr\",\"status\":\"nc\",\"percentComplete\":88.47944,\"startTime\":\"2021-09-21T10:04:50Z\",\"endTime\":\"2021-08-20T13:44:39Z\",\"operations\":[{\"id\":\"zhlctddunqndyfpc\",\"name\":\"qbnj\",\"status\":\"rcgegydcwboxjum\",\"percentComplete\":24.987305,\"startTime\":\"2021-10-07T14:13:44Z\",\"endTime\":\"2021-07-31T07:50:02Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapDatabaseInstances() - .stopInstance( - "kcxk", - "ibn", - "mysu", - new StopRequest().withSoftStopTimeoutSeconds(1681315217566563441L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ntvlwijpsttexo", response.id()); - Assertions.assertEquals("pwcyyufmhr", response.name()); - Assertions.assertEquals("nc", response.status()); - Assertions.assertEquals(88.47944F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T10:04:50Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-20T13:44:39Z"), response.endTime()); - Assertions.assertEquals("zhlctddunqndyfpc", response.operations().get(0).id()); - Assertions.assertEquals("qbnj", response.operations().get(0).name()); - Assertions.assertEquals("rcgegydcwboxjum", response.operations().get(0).status()); - Assertions.assertEquals(24.987305F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-07T14:13:44Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T07:50:02Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationTests.java deleted file mode 100644 index c83f758b174c..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.DiskDetails; -import com.azure.resourcemanager.workloads.models.DiskSku; -import com.azure.resourcemanager.workloads.models.DiskSkuName; -import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration; -import com.azure.resourcemanager.workloads.models.SapDiskConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapDiskConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapDiskConfiguration model = - BinaryData - .fromString( - "{\"recommendedConfiguration\":{\"count\":7163568356518394603,\"sizeGB\":938163857275784583,\"sku\":{\"name\":\"PremiumV2_LRS\"}},\"supportedConfigurations\":[{\"sku\":{\"name\":\"UltraSSD_LRS\"},\"sizeGB\":6890840342903312019,\"minimumSupportedDiskCount\":6098942127121377639,\"maximumSupportedDiskCount\":7308436367150824433,\"iopsReadWrite\":1567678821277851010,\"mbpsReadWrite\":8302954057449968569,\"diskTier\":\"psqucmpoyf\"},{\"sku\":{\"name\":\"Premium_LRS\"},\"sizeGB\":4012686120572147528,\"minimumSupportedDiskCount\":6712516105005203400,\"maximumSupportedDiskCount\":7418697868899624743,\"iopsReadWrite\":4127897612120681391,\"mbpsReadWrite\":973731230377529737,\"diskTier\":\"eupewnwreitjz\"},{\"sku\":{\"name\":\"StandardSSD_LRS\"},\"sizeGB\":3686137269539867377,\"minimumSupportedDiskCount\":5128252551550278404,\"maximumSupportedDiskCount\":5048423606513513533,\"iopsReadWrite\":2535253353420695473,\"mbpsReadWrite\":8218653315746121665,\"diskTier\":\"dtmlxhekuksjt\"},{\"sku\":{\"name\":\"UltraSSD_LRS\"},\"sizeGB\":3684362268080006128,\"minimumSupportedDiskCount\":8311837114638823243,\"maximumSupportedDiskCount\":743663973345531285,\"iopsReadWrite\":7105688458172828807,\"mbpsReadWrite\":8444265625651342832,\"diskTier\":\"dxtayrlhm\"}]}") - .toObject(SapDiskConfiguration.class); - Assertions.assertEquals(7163568356518394603L, model.recommendedConfiguration().count()); - Assertions.assertEquals(938163857275784583L, model.recommendedConfiguration().sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_V2_LRS, model.recommendedConfiguration().sku().name()); - Assertions.assertEquals(DiskSkuName.ULTRA_SSD_LRS, model.supportedConfigurations().get(0).sku().name()); - Assertions.assertEquals(6890840342903312019L, model.supportedConfigurations().get(0).sizeGB()); - Assertions - .assertEquals(6098942127121377639L, model.supportedConfigurations().get(0).minimumSupportedDiskCount()); - Assertions - .assertEquals(7308436367150824433L, model.supportedConfigurations().get(0).maximumSupportedDiskCount()); - Assertions.assertEquals(1567678821277851010L, model.supportedConfigurations().get(0).iopsReadWrite()); - Assertions.assertEquals(8302954057449968569L, model.supportedConfigurations().get(0).mbpsReadWrite()); - Assertions.assertEquals("psqucmpoyf", model.supportedConfigurations().get(0).diskTier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapDiskConfiguration model = - new SapDiskConfiguration() - .withRecommendedConfiguration( - new DiskVolumeConfiguration() - .withCount(7163568356518394603L) - .withSizeGB(938163857275784583L) - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_V2_LRS))) - .withSupportedConfigurations( - Arrays - .asList( - new DiskDetails() - .withSku(new DiskSku().withName(DiskSkuName.ULTRA_SSD_LRS)) - .withSizeGB(6890840342903312019L) - .withMinimumSupportedDiskCount(6098942127121377639L) - .withMaximumSupportedDiskCount(7308436367150824433L) - .withIopsReadWrite(1567678821277851010L) - .withMbpsReadWrite(8302954057449968569L) - .withDiskTier("psqucmpoyf"), - new DiskDetails() - .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)) - .withSizeGB(4012686120572147528L) - .withMinimumSupportedDiskCount(6712516105005203400L) - .withMaximumSupportedDiskCount(7418697868899624743L) - .withIopsReadWrite(4127897612120681391L) - .withMbpsReadWrite(973731230377529737L) - .withDiskTier("eupewnwreitjz"), - new DiskDetails() - .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)) - .withSizeGB(3686137269539867377L) - .withMinimumSupportedDiskCount(5128252551550278404L) - .withMaximumSupportedDiskCount(5048423606513513533L) - .withIopsReadWrite(2535253353420695473L) - .withMbpsReadWrite(8218653315746121665L) - .withDiskTier("dtmlxhekuksjt"), - new DiskDetails() - .withSku(new DiskSku().withName(DiskSkuName.ULTRA_SSD_LRS)) - .withSizeGB(3684362268080006128L) - .withMinimumSupportedDiskCount(8311837114638823243L) - .withMaximumSupportedDiskCount(743663973345531285L) - .withIopsReadWrite(7105688458172828807L) - .withMbpsReadWrite(8444265625651342832L) - .withDiskTier("dxtayrlhm"))); - model = BinaryData.fromObject(model).toObject(SapDiskConfiguration.class); - Assertions.assertEquals(7163568356518394603L, model.recommendedConfiguration().count()); - Assertions.assertEquals(938163857275784583L, model.recommendedConfiguration().sizeGB()); - Assertions.assertEquals(DiskSkuName.PREMIUM_V2_LRS, model.recommendedConfiguration().sku().name()); - Assertions.assertEquals(DiskSkuName.ULTRA_SSD_LRS, model.supportedConfigurations().get(0).sku().name()); - Assertions.assertEquals(6890840342903312019L, model.supportedConfigurations().get(0).sizeGB()); - Assertions - .assertEquals(6098942127121377639L, model.supportedConfigurations().get(0).minimumSupportedDiskCount()); - Assertions - .assertEquals(7308436367150824433L, model.supportedConfigurations().get(0).maximumSupportedDiskCount()); - Assertions.assertEquals(1567678821277851010L, model.supportedConfigurations().get(0).iopsReadWrite()); - Assertions.assertEquals(8302954057449968569L, model.supportedConfigurations().get(0).mbpsReadWrite()); - Assertions.assertEquals("psqucmpoyf", model.supportedConfigurations().get(0).diskTier()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsRequestTests.java deleted file mode 100644 index 1cdef87b8ef3..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsRequestTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import org.junit.jupiter.api.Assertions; - -public final class SapDiskConfigurationsRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapDiskConfigurationsRequest model = - BinaryData - .fromString( - "{\"appLocation\":\"tbmufpo\",\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"databaseType\":\"HANA\",\"deploymentType\":\"SingleServer\",\"dbVmSku\":\"hwlrx\"}") - .toObject(SapDiskConfigurationsRequest.class); - Assertions.assertEquals("tbmufpo", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.ECC, model.sapProduct()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals("hwlrx", model.dbVmSku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapDiskConfigurationsRequest model = - new SapDiskConfigurationsRequest() - .withAppLocation("tbmufpo") - .withEnvironment(SapEnvironmentType.NON_PROD) - .withSapProduct(SapProductType.ECC) - .withDatabaseType(SapDatabaseType.HANA) - .withDeploymentType(SapDeploymentType.SINGLE_SERVER) - .withDbVmSku("hwlrx"); - model = BinaryData.fromObject(model).toObject(SapDiskConfigurationsRequest.class); - Assertions.assertEquals("tbmufpo", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.ECC, model.sapProduct()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals("hwlrx", model.dbVmSku()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsResultInnerTests.java deleted file mode 100644 index abe59b28c39e..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapDiskConfigurationsResultInnerTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; -import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration; -import com.azure.resourcemanager.workloads.models.SapDiskConfiguration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapDiskConfigurationsResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapDiskConfigurationsResultInner model = - BinaryData - .fromString( - "{\"volumeConfigurations\":{\"pazlobcufpdz\":{\"recommendedConfiguration\":{\"count\":5896484997878560092,\"sizeGB\":5423097764274102889},\"supportedConfigurations\":[]},\"lhqgnufooojy\":{\"recommendedConfiguration\":{\"count\":733466437358115738,\"sizeGB\":8147558301655778049},\"supportedConfigurations\":[]},\"f\":{\"recommendedConfiguration\":{\"count\":2890649566482151076,\"sizeGB\":5829042994931882548},\"supportedConfigurations\":[]}}}") - .toObject(SapDiskConfigurationsResultInner.class); - Assertions - .assertEquals( - 5896484997878560092L, - model.volumeConfigurations().get("pazlobcufpdz").recommendedConfiguration().count()); - Assertions - .assertEquals( - 5423097764274102889L, - model.volumeConfigurations().get("pazlobcufpdz").recommendedConfiguration().sizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapDiskConfigurationsResultInner model = - new SapDiskConfigurationsResultInner() - .withVolumeConfigurations( - mapOf( - "pazlobcufpdz", - new SapDiskConfiguration() - .withRecommendedConfiguration( - new DiskVolumeConfiguration() - .withCount(5896484997878560092L) - .withSizeGB(5423097764274102889L)) - .withSupportedConfigurations(Arrays.asList()), - "lhqgnufooojy", - new SapDiskConfiguration() - .withRecommendedConfiguration( - new DiskVolumeConfiguration() - .withCount(733466437358115738L) - .withSizeGB(8147558301655778049L)) - .withSupportedConfigurations(Arrays.asList()), - "f", - new SapDiskConfiguration() - .withRecommendedConfiguration( - new DiskVolumeConfiguration() - .withCount(2890649566482151076L) - .withSizeGB(5829042994931882548L)) - .withSupportedConfigurations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(SapDiskConfigurationsResultInner.class); - Assertions - .assertEquals( - 5896484997878560092L, - model.volumeConfigurations().get("pazlobcufpdz").recommendedConfiguration().count()); - Assertions - .assertEquals( - 5423097764274102889L, - model.volumeConfigurations().get("pazlobcufpdz").recommendedConfiguration().sizeGB()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorInnerTests.java deleted file mode 100644 index 0e743925d3b9..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"grouping\":{\"landscape\":[],\"sapApplication\":[]},\"topMetricsThresholds\":[{\"name\":\"mpgcjefuzmuvpbt\",\"green\":11.969751,\"yellow\":78.04989,\"red\":2.2329688}]},\"id\":\"xe\",\"name\":\"mnzb\",\"type\":\"bhjpglkfgohdne\"}") - .toObject(SapLandscapeMonitorInner.class); - Assertions.assertEquals("mpgcjefuzmuvpbt", model.topMetricsThresholds().get(0).name()); - Assertions.assertEquals(11.969751F, model.topMetricsThresholds().get(0).green()); - Assertions.assertEquals(78.04989F, model.topMetricsThresholds().get(0).yellow()); - Assertions.assertEquals(2.2329688F, model.topMetricsThresholds().get(0).red()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorInner model = - new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape(Arrays.asList()) - .withSapApplication(Arrays.asList())) - .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("mpgcjefuzmuvpbt") - .withGreen(11.969751F) - .withYellow(78.04989F) - .withRed(2.2329688F))); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorInner.class); - Assertions.assertEquals("mpgcjefuzmuvpbt", model.topMetricsThresholds().get(0).name()); - Assertions.assertEquals(11.969751F, model.topMetricsThresholds().get(0).green()); - Assertions.assertEquals(78.04989F, model.topMetricsThresholds().get(0).yellow()); - Assertions.assertEquals(2.2329688F, model.topMetricsThresholds().get(0).red()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListResultInnerTests.java deleted file mode 100644 index 121735d5545a..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorListResultInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorListResultInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"topMetricsThresholds\":[]},\"id\":\"ibahwflus\",\"name\":\"dtmhrkwofyyvoqa\",\"type\":\"piexpbtgiw\"}],\"nextLink\":\"oenwashr\"}") - .toObject(SapLandscapeMonitorListResultInner.class); - Assertions.assertEquals("oenwashr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorListResultInner model = - new SapLandscapeMonitorListResultInner() - .withValue(Arrays.asList(new SapLandscapeMonitorInner().withTopMetricsThresholds(Arrays.asList()))) - .withNextLink("oenwashr"); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorListResultInner.class); - Assertions.assertEquals("oenwashr", model.nextLink()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorMetricThresholdsTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorMetricThresholdsTests.java deleted file mode 100644 index 16472b6e30eb..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorMetricThresholdsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorMetricThresholdsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorMetricThresholds model = - BinaryData - .fromString("{\"name\":\"osx\",\"green\":88.55184,\"yellow\":65.27517,\"red\":5.093771}") - .toObject(SapLandscapeMonitorMetricThresholds.class); - Assertions.assertEquals("osx", model.name()); - Assertions.assertEquals(88.55184F, model.green()); - Assertions.assertEquals(65.27517F, model.yellow()); - Assertions.assertEquals(5.093771F, model.red()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorMetricThresholds model = - new SapLandscapeMonitorMetricThresholds() - .withName("osx") - .withGreen(88.55184F) - .withYellow(65.27517F) - .withRed(5.093771F); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorMetricThresholds.class); - Assertions.assertEquals("osx", model.name()); - Assertions.assertEquals(88.55184F, model.green()); - Assertions.assertEquals(65.27517F, model.yellow()); - Assertions.assertEquals(5.093771F, model.red()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesGroupingTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesGroupingTests.java deleted file mode 100644 index 75e7a9047406..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesGroupingTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorPropertiesGroupingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorPropertiesGrouping model = - BinaryData - .fromString( - "{\"landscape\":[{\"name\":\"sag\",\"topSid\":[\"nihgwqapnedg\",\"bcvkcvqvpkeq\",\"cvdrhvoodsot\",\"obzdopcjwvnhdl\"]},{\"name\":\"mgxcxrslpm\",\"topSid\":[\"uoegrpkhjwniyqs\",\"uicpd\"]},{\"name\":\"kzzlvmbmpaxmodf\",\"topSid\":[\"fy\"]},{\"name\":\"bpfvm\",\"topSid\":[\"rfouyftaakcpw\",\"yzvqt\"]}],\"sapApplication\":[{\"name\":\"exkpzksmondjmq\",\"topSid\":[\"ypomgkopkwho\",\"v\",\"ajqgxy\",\"mocmbqfqvmk\"]}]}") - .toObject(SapLandscapeMonitorPropertiesGrouping.class); - Assertions.assertEquals("sag", model.landscape().get(0).name()); - Assertions.assertEquals("nihgwqapnedg", model.landscape().get(0).topSid().get(0)); - Assertions.assertEquals("exkpzksmondjmq", model.sapApplication().get(0).name()); - Assertions.assertEquals("ypomgkopkwho", model.sapApplication().get(0).topSid().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorPropertiesGrouping model = - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("sag") - .withTopSid( - Arrays.asList("nihgwqapnedg", "bcvkcvqvpkeq", "cvdrhvoodsot", "obzdopcjwvnhdl")), - new SapLandscapeMonitorSidMapping() - .withName("mgxcxrslpm") - .withTopSid(Arrays.asList("uoegrpkhjwniyqs", "uicpd")), - new SapLandscapeMonitorSidMapping() - .withName("kzzlvmbmpaxmodf") - .withTopSid(Arrays.asList("fy")), - new SapLandscapeMonitorSidMapping() - .withName("bpfvm") - .withTopSid(Arrays.asList("rfouyftaakcpw", "yzvqt")))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("exkpzksmondjmq") - .withTopSid(Arrays.asList("ypomgkopkwho", "v", "ajqgxy", "mocmbqfqvmk")))); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorPropertiesGrouping.class); - Assertions.assertEquals("sag", model.landscape().get(0).name()); - Assertions.assertEquals("nihgwqapnedg", model.landscape().get(0).topSid().get(0)); - Assertions.assertEquals("exkpzksmondjmq", model.sapApplication().get(0).name()); - Assertions.assertEquals("ypomgkopkwho", model.sapApplication().get(0).topSid().get(0)); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesTests.java deleted file mode 100644 index 62d704905a13..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorPropertiesTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorProperties; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorMetricThresholds; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Accepted\",\"grouping\":{\"landscape\":[{\"name\":\"dyhtozfikdowwquu\",\"topSid\":[]}],\"sapApplication\":[{\"name\":\"lvithhqzonosgg\",\"topSid\":[]},{\"name\":\"ohfwds\",\"topSid\":[]}]},\"topMetricsThresholds\":[{\"name\":\"jutiiswacff\",\"green\":6.1475635,\"yellow\":20.9651,\"red\":76.94174},{\"name\":\"fvhqc\",\"green\":81.842606,\"yellow\":27.79339,\"red\":1.6355693},{\"name\":\"pfuflrw\",\"green\":90.98357,\"yellow\":28.890497,\"red\":79.59478}]}") - .toObject(SapLandscapeMonitorProperties.class); - Assertions.assertEquals("dyhtozfikdowwquu", model.grouping().landscape().get(0).name()); - Assertions.assertEquals("lvithhqzonosgg", model.grouping().sapApplication().get(0).name()); - Assertions.assertEquals("jutiiswacff", model.topMetricsThresholds().get(0).name()); - Assertions.assertEquals(6.1475635F, model.topMetricsThresholds().get(0).green()); - Assertions.assertEquals(20.9651F, model.topMetricsThresholds().get(0).yellow()); - Assertions.assertEquals(76.94174F, model.topMetricsThresholds().get(0).red()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorProperties model = - new SapLandscapeMonitorProperties() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("dyhtozfikdowwquu") - .withTopSid(Arrays.asList()))) - .withSapApplication( - Arrays - .asList( - new SapLandscapeMonitorSidMapping() - .withName("lvithhqzonosgg") - .withTopSid(Arrays.asList()), - new SapLandscapeMonitorSidMapping() - .withName("ohfwds") - .withTopSid(Arrays.asList())))) - .withTopMetricsThresholds( - Arrays - .asList( - new SapLandscapeMonitorMetricThresholds() - .withName("jutiiswacff") - .withGreen(6.1475635F) - .withYellow(20.9651F) - .withRed(76.94174F), - new SapLandscapeMonitorMetricThresholds() - .withName("fvhqc") - .withGreen(81.842606F) - .withYellow(27.79339F) - .withRed(1.6355693F), - new SapLandscapeMonitorMetricThresholds() - .withName("pfuflrw") - .withGreen(90.98357F) - .withYellow(28.890497F) - .withRed(79.59478F))); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorProperties.class); - Assertions.assertEquals("dyhtozfikdowwquu", model.grouping().landscape().get(0).name()); - Assertions.assertEquals("lvithhqzonosgg", model.grouping().sapApplication().get(0).name()); - Assertions.assertEquals("jutiiswacff", model.topMetricsThresholds().get(0).name()); - Assertions.assertEquals(6.1475635F, model.topMetricsThresholds().get(0).green()); - Assertions.assertEquals(20.9651F, model.topMetricsThresholds().get(0).yellow()); - Assertions.assertEquals(76.94174F, model.topMetricsThresholds().get(0).red()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorSidMappingTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorSidMappingTests.java deleted file mode 100644 index 4dc61c98fadd..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorSidMappingTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorSidMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapLandscapeMonitorSidMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapLandscapeMonitorSidMapping model = - BinaryData - .fromString("{\"name\":\"oz\",\"topSid\":[\"helxprglya\",\"dd\",\"kcbcue\",\"rjxgciqib\"]}") - .toObject(SapLandscapeMonitorSidMapping.class); - Assertions.assertEquals("oz", model.name()); - Assertions.assertEquals("helxprglya", model.topSid().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapLandscapeMonitorSidMapping model = - new SapLandscapeMonitorSidMapping() - .withName("oz") - .withTopSid(Arrays.asList("helxprglya", "dd", "kcbcue", "rjxgciqib")); - model = BinaryData.fromObject(model).toObject(SapLandscapeMonitorSidMapping.class); - Assertions.assertEquals("oz", model.name()); - Assertions.assertEquals("helxprglya", model.topSid().get(0)); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsCreateWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsCreateWithResponseMockTests.java deleted file mode 100644 index 03df0c2e5156..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsCreateWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitor; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -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 SapLandscapeMonitorsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Created\",\"grouping\":{\"landscape\":[],\"sapApplication\":[]},\"topMetricsThresholds\":[]},\"id\":\"xgpnr\",\"name\":\"govfgpikqmhhaow\",\"type\":\"rmzvupo\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapLandscapeMonitor response = - manager - .sapLandscapeMonitors() - .createWithResponse( - "yxrxmunj", - "xvglnkvxlxp", - new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape(Arrays.asList()) - .withSapApplication(Arrays.asList())) - .withTopMetricsThresholds(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 5c233f140af7..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -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 SapLandscapeMonitorsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .sapLandscapeMonitors() - .deleteByResourceGroupWithResponse("qzdfuydzvkfvxcn", "mx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsGetWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsGetWithResponseMockTests.java deleted file mode 100644 index 9bc079c52550..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitor; -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 SapLandscapeMonitorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"grouping\":{\"landscape\":[],\"sapApplication\":[]},\"topMetricsThresholds\":[]},\"id\":\"pssdfppyogtie\",\"name\":\"ujtv\",\"type\":\"zkc\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapLandscapeMonitor response = - manager - .sapLandscapeMonitors() - .getWithResponse("bmzyospsps", "c", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsListWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsListWithResponseMockTests.java deleted file mode 100644 index aec5dde34716..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsListWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorListResult; -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 SapLandscapeMonitorsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"biattgplucfotan\",\"name\":\"c\",\"type\":\"hnykz\"},{\"id\":\"swvxwlmzqwmv\",\"name\":\"xnjmxm\",\"type\":\"uqudtcvclxyn\"}],\"nextLink\":\"k\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapLandscapeMonitorListResult response = - manager - .sapLandscapeMonitors() - .listWithResponse("gmwohqfzizvu", "mmkjsvthnwpztek", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("k", response.nextLink()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsUpdateWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsUpdateWithResponseMockTests.java deleted file mode 100644 index 33cb454dc410..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapLandscapeMonitorsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.fluent.models.SapLandscapeMonitorInner; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitor; -import com.azure.resourcemanager.workloads.models.SapLandscapeMonitorPropertiesGrouping; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -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 SapLandscapeMonitorsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Created\",\"grouping\":{\"landscape\":[],\"sapApplication\":[]},\"topMetricsThresholds\":[]},\"id\":\"dths\",\"name\":\"qgvriibakcla\",\"type\":\"jfrnxousxauzlwv\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapLandscapeMonitor response = - manager - .sapLandscapeMonitors() - .updateWithResponse( - "psw", - "kmvkhl", - new SapLandscapeMonitorInner() - .withGrouping( - new SapLandscapeMonitorPropertiesGrouping() - .withLandscape(Arrays.asList()) - .withSapApplication(Arrays.asList())) - .withTopMetricsThresholds(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationRequestTests.java deleted file mode 100644 index e1692528b3a9..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationRequestTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapDatabaseScaleMethod; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; -import org.junit.jupiter.api.Assertions; - -public final class SapSizingRecommendationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapSizingRecommendationRequest model = - BinaryData - .fromString( - "{\"appLocation\":\"mmhquvgjxpyb\",\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"deploymentType\":\"SingleServer\",\"saps\":5740075632492893459,\"dbMemory\":8216479127673757607,\"databaseType\":\"HANA\",\"dbScaleMethod\":\"ScaleUp\",\"highAvailabilityType\":\"AvailabilityZone\"}") - .toObject(SapSizingRecommendationRequest.class); - Assertions.assertEquals("mmhquvgjxpyb", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.ECC, model.sapProduct()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals(5740075632492893459L, model.saps()); - Assertions.assertEquals(8216479127673757607L, model.dbMemory()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapDatabaseScaleMethod.SCALE_UP, model.dbScaleMethod()); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapSizingRecommendationRequest model = - new SapSizingRecommendationRequest() - .withAppLocation("mmhquvgjxpyb") - .withEnvironment(SapEnvironmentType.NON_PROD) - .withSapProduct(SapProductType.ECC) - .withDeploymentType(SapDeploymentType.SINGLE_SERVER) - .withSaps(5740075632492893459L) - .withDbMemory(8216479127673757607L) - .withDatabaseType(SapDatabaseType.HANA) - .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE); - model = BinaryData.fromObject(model).toObject(SapSizingRecommendationRequest.class); - Assertions.assertEquals("mmhquvgjxpyb", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.ECC, model.sapProduct()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals(5740075632492893459L, model.saps()); - Assertions.assertEquals(8216479127673757607L, model.dbMemory()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapDatabaseScaleMethod.SCALE_UP, model.dbScaleMethod()); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationResultInnerTests.java deleted file mode 100644 index 7b1b9d729bbc..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSizingRecommendationResultInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; - -public final class SapSizingRecommendationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapSizingRecommendationResultInner model = - BinaryData - .fromString("{\"deploymentType\":\"SapSizingRecommendationResult\"}") - .toObject(SapSizingRecommendationResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapSizingRecommendationResultInner model = new SapSizingRecommendationResultInner(); - model = BinaryData.fromObject(model).toObject(SapSizingRecommendationResultInner.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedResourceSkusResultInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedResourceSkusResultInnerTests.java deleted file mode 100644 index 2eba33924028..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedResourceSkusResultInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; -import com.azure.resourcemanager.workloads.models.SapSupportedSku; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SapSupportedResourceSkusResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapSupportedResourceSkusResultInner model = - BinaryData - .fromString( - "{\"supportedSkus\":[{\"vmSku\":\"ejhphoyc\",\"isAppServerCertified\":true,\"isDatabaseCertified\":true}]}") - .toObject(SapSupportedResourceSkusResultInner.class); - Assertions.assertEquals("ejhphoyc", model.supportedSkus().get(0).vmSku()); - Assertions.assertEquals(true, model.supportedSkus().get(0).isAppServerCertified()); - Assertions.assertEquals(true, model.supportedSkus().get(0).isDatabaseCertified()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapSupportedResourceSkusResultInner model = - new SapSupportedResourceSkusResultInner() - .withSupportedSkus( - Arrays - .asList( - new SapSupportedSku() - .withVmSku("ejhphoyc") - .withIsAppServerCertified(true) - .withIsDatabaseCertified(true))); - model = BinaryData.fromObject(model).toObject(SapSupportedResourceSkusResultInner.class); - Assertions.assertEquals("ejhphoyc", model.supportedSkus().get(0).vmSku()); - Assertions.assertEquals(true, model.supportedSkus().get(0).isAppServerCertified()); - Assertions.assertEquals(true, model.supportedSkus().get(0).isDatabaseCertified()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkuTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkuTests.java deleted file mode 100644 index 491307c05013..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkuTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapSupportedSku; -import org.junit.jupiter.api.Assertions; - -public final class SapSupportedSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapSupportedSku model = - BinaryData - .fromString("{\"vmSku\":\"hdxbmtqio\",\"isAppServerCertified\":false,\"isDatabaseCertified\":false}") - .toObject(SapSupportedSku.class); - Assertions.assertEquals("hdxbmtqio", model.vmSku()); - Assertions.assertEquals(false, model.isAppServerCertified()); - Assertions.assertEquals(false, model.isDatabaseCertified()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapSupportedSku model = - new SapSupportedSku().withVmSku("hdxbmtqio").withIsAppServerCertified(false).withIsDatabaseCertified(false); - model = BinaryData.fromObject(model).toObject(SapSupportedSku.class); - Assertions.assertEquals("hdxbmtqio", model.vmSku()); - Assertions.assertEquals(false, model.isAppServerCertified()); - Assertions.assertEquals(false, model.isDatabaseCertified()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkusRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkusRequestTests.java deleted file mode 100644 index 0a9fa3659d31..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapSupportedSkusRequestTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapDeploymentType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; -import org.junit.jupiter.api.Assertions; - -public final class SapSupportedSkusRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapSupportedSkusRequest model = - BinaryData - .fromString( - "{\"appLocation\":\"h\",\"environment\":\"NonProd\",\"sapProduct\":\"Other\",\"deploymentType\":\"SingleServer\",\"databaseType\":\"HANA\",\"highAvailabilityType\":\"AvailabilityZone\"}") - .toObject(SapSupportedSkusRequest.class); - Assertions.assertEquals("h", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapSupportedSkusRequest model = - new SapSupportedSkusRequest() - .withAppLocation("h") - .withEnvironment(SapEnvironmentType.NON_PROD) - .withSapProduct(SapProductType.OTHER) - .withDeploymentType(SapDeploymentType.SINGLE_SERVER) - .withDatabaseType(SapDatabaseType.HANA) - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE); - model = BinaryData.fromObject(model).toObject(SapSupportedSkusRequest.class); - Assertions.assertEquals("h", model.appLocation()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals(SapDeploymentType.SINGLE_SERVER, model.deploymentType()); - Assertions.assertEquals(SapDatabaseType.HANA, model.databaseType()); - Assertions.assertEquals(SapHighAvailabilityType.AVAILABILITY_ZONE, model.highAvailabilityType()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceInnerTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceInnerTests.java deleted file mode 100644 index db8c68ba9124..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceInnerTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; -import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapConfiguration; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.UserAssignedIdentity; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapVirtualInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapVirtualInstanceInner model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"czbysc\":{\"principalId\":\"94a4d0db-2e20-4b6f-ac9d-b804f069cf1c\",\"clientId\":\"68d87d5d-90d9-44e6-9570-fddc02e43cce\"},\"x\":{\"principalId\":\"a5c8e0a5-f6d0-4197-af49-01576693acf1\",\"clientId\":\"e244f947-34a2-42ac-9099-acfd37b92c49\"},\"vyq\":{\"principalId\":\"8042015a-193f-425e-b08d-289bdefc6e43\",\"clientId\":\"075d99e5-0d87-4c88-af16-a6bb95d8c353\"},\"b\":{\"principalId\":\"6cd81a23-bbd6-4290-bff8-b51213d48c08\",\"clientId\":\"a67ed7c5-8b31-4471-a94c-b53d95e32ba2\"}}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"Other\",\"configuration\":{\"configurationType\":\"SapConfiguration\"},\"managedResourceGroupConfiguration\":{\"name\":\"vd\"},\"status\":\"Running\",\"health\":\"Unknown\",\"state\":\"DiscoveryInProgress\",\"provisioningState\":\"Updating\",\"errors\":{}},\"location\":\"gaudcc\",\"tags\":{\"cnyejhkryhtnapcz\":\"s\"},\"id\":\"lokjyemkk\",\"name\":\"ni\",\"type\":\"joxzjnchgejspodm\"}") - .toObject(SapVirtualInstanceInner.class); - Assertions.assertEquals("gaudcc", model.location()); - Assertions.assertEquals("s", model.tags().get("cnyejhkryhtnapcz")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals("vd", model.managedResourceGroupConfiguration().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapVirtualInstanceInner model = - new SapVirtualInstanceInner() - .withLocation("gaudcc") - .withTags(mapOf("cnyejhkryhtnapcz", "s")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "czbysc", - new UserAssignedIdentity(), - "x", - new UserAssignedIdentity(), - "vyq", - new UserAssignedIdentity(), - "b", - new UserAssignedIdentity()))) - .withEnvironment(SapEnvironmentType.NON_PROD) - .withSapProduct(SapProductType.OTHER) - .withConfiguration(new SapConfiguration()) - .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("vd")); - model = BinaryData.fromObject(model).toObject(SapVirtualInstanceInner.class); - Assertions.assertEquals("gaudcc", model.location()); - Assertions.assertEquals("s", model.tags().get("cnyejhkryhtnapcz")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.environment()); - Assertions.assertEquals(SapProductType.OTHER, model.sapProduct()); - Assertions.assertEquals("vd", model.managedResourceGroupConfiguration().name()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceListTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceListTests.java deleted file mode 100644 index 512dc7b9ba99..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstanceListTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapVirtualInstanceList; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SapVirtualInstanceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SapVirtualInstanceList model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"status\":\"Stopping\",\"health\":\"Unknown\",\"state\":\"DiscoveryInProgress\",\"provisioningState\":\"Failed\"},\"location\":\"jaeq\",\"tags\":{\"tnb\":\"jbasvmsmjqulngs\",\"wrljdouskc\":\"bkzgcwrwclx\"},\"id\":\"vkocrcjdkwtn\",\"name\":\"xbnjbiksq\",\"type\":\"gls\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"Prod\",\"sapProduct\":\"S4HANA\",\"status\":\"SoftShutdown\",\"health\":\"Unhealthy\",\"state\":\"RegistrationComplete\",\"provisioningState\":\"Failed\"},\"location\":\"eebvmgxsab\",\"tags\":{\"c\":\"duuji\",\"dhkrwpdappdsbdk\":\"czdzev\",\"nhutjeltmrldhugj\":\"wrwjfeu\",\"ablgphuticndvk\":\"zdatqxhocdg\"},\"id\":\"ozwyiftyhxhuro\",\"name\":\"ftyxolniw\",\"type\":\"wcukjfkgiawxk\"},{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"Prod\",\"sapProduct\":\"ECC\",\"status\":\"Starting\",\"health\":\"Unknown\",\"state\":\"InfrastructureDeploymentFailed\",\"provisioningState\":\"Updating\"},\"location\":\"hsgcbacphejkot\",\"tags\":{\"zndlikwy\":\"gou\",\"bmadgak\":\"kgfg\"},\"id\":\"qsrxybzqqed\",\"name\":\"ytb\",\"type\":\"iqfouflmmnkz\"}],\"nextLink\":\"odmgl\"}") - .toObject(SapVirtualInstanceList.class); - Assertions.assertEquals("jaeq", model.value().get(0).location()); - Assertions.assertEquals("jbasvmsmjqulngs", model.value().get(0).tags().get("tnb")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.value().get(0).environment()); - Assertions.assertEquals(SapProductType.ECC, model.value().get(0).sapProduct()); - Assertions.assertEquals("odmgl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SapVirtualInstanceList model = - new SapVirtualInstanceList() - .withValue( - Arrays - .asList( - new SapVirtualInstanceInner() - .withLocation("jaeq") - .withTags(mapOf("tnb", "jbasvmsmjqulngs", "wrljdouskc", "bkzgcwrwclx")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withEnvironment(SapEnvironmentType.NON_PROD) - .withSapProduct(SapProductType.ECC), - new SapVirtualInstanceInner() - .withLocation("eebvmgxsab") - .withTags( - mapOf( - "c", - "duuji", - "dhkrwpdappdsbdk", - "czdzev", - "nhutjeltmrldhugj", - "wrwjfeu", - "ablgphuticndvk", - "zdatqxhocdg")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.S4HANA), - new SapVirtualInstanceInner() - .withLocation("hsgcbacphejkot") - .withTags(mapOf("zndlikwy", "gou", "bmadgak", "kgfg")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.ECC))) - .withNextLink("odmgl"); - model = BinaryData.fromObject(model).toObject(SapVirtualInstanceList.class); - Assertions.assertEquals("jaeq", model.value().get(0).location()); - Assertions.assertEquals("jbasvmsmjqulngs", model.value().get(0).tags().get("tnb")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, model.value().get(0).environment()); - Assertions.assertEquals(SapProductType.ECC, model.value().get(0).sapProduct()); - Assertions.assertEquals("odmgl", model.nextLink()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateMockTests.java deleted file mode 100644 index d332a5d0b98f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateMockTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapConfiguration; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapVirtualInstance; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SapVirtualInstancesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"Other\",\"configuration\":{\"configurationType\":\"SapConfiguration\"},\"managedResourceGroupConfiguration\":{\"name\":\"ydzgkrvqeevtoe\"},\"status\":\"SoftShutdown\",\"health\":\"Unknown\",\"state\":\"RegistrationComplete\",\"provisioningState\":\"Succeeded\",\"errors\":{}},\"location\":\"mov\",\"tags\":{\"wzqa\":\"va\",\"gzuriglaecxndt\":\"f\"},\"id\":\"cokpv\",\"name\":\"mlqtmldgxob\",\"type\":\"irclnpk\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapVirtualInstance response = - manager - .sapVirtualInstances() - .define("vwzjbhyz") - .withRegion("tjb") - .withExistingResourceGroup("vdwxfzwi") - .withEnvironment(SapEnvironmentType.PROD) - .withSapProduct(SapProductType.OTHER) - .withConfiguration(new SapConfiguration()) - .withTags(mapOf("jlxr", "mflvest", "wk", "ilozapeewchpxlk")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("rnegvmn")) - .create(); - - Assertions.assertEquals("mov", response.location()); - Assertions.assertEquals("va", response.tags().get("wzqa")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, response.environment()); - Assertions.assertEquals(SapProductType.OTHER, response.sapProduct()); - Assertions.assertEquals("ydzgkrvqeevtoe", response.managedResourceGroupConfiguration().name()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteMockTests.java deleted file mode 100644 index 694fa44e0790..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapVirtualInstancesDeleteMockTests { - @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 = - "{\"id\":\"vcyy\",\"name\":\"fgdo\",\"status\":\"cubiipuipw\",\"percentComplete\":63.20965,\"startTime\":\"2021-04-29T06:53:37Z\",\"endTime\":\"2021-09-14T04:06:38Z\",\"operations\":[{\"id\":\"nizshqvcim\",\"name\":\"vfgmblrrilby\",\"status\":\"dxsm\",\"percentComplete\":31.605476,\"startTime\":\"2021-03-19T10:07:06Z\",\"endTime\":\"2021-05-11T00:41:26Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.sapVirtualInstances().delete("xmsivfomiloxggdu", "iqndieuzaofj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vcyy", response.id()); - Assertions.assertEquals("fgdo", response.name()); - Assertions.assertEquals("cubiipuipw", response.status()); - Assertions.assertEquals(63.20965F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-29T06:53:37Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T04:06:38Z"), response.endTime()); - Assertions.assertEquals("nizshqvcim", response.operations().get(0).id()); - Assertions.assertEquals("vfgmblrrilby", response.operations().get(0).name()); - Assertions.assertEquals("dxsm", response.operations().get(0).status()); - Assertions.assertEquals(31.605476F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-19T10:07:06Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-11T00:41:26Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupWithResponseMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6a30552a4665..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapVirtualInstance; -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 SapVirtualInstancesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"configuration\":{\"configurationType\":\"SapConfiguration\"},\"managedResourceGroupConfiguration\":{\"name\":\"lqubkwdlen\"},\"status\":\"SoftShutdown\",\"health\":\"Unhealthy\",\"state\":\"DiscoveryFailed\",\"provisioningState\":\"Updating\",\"errors\":{}},\"location\":\"uo\",\"tags\":{\"rwm\":\"nyfln\",\"xpgpq\":\"uvwpklvxwmyg\",\"daxconfozauorsuk\":\"hiszepnnbjcrxgib\",\"pzlrphw\":\"kwbqplhlvnuu\"},\"id\":\"soldweyuqdunv\",\"name\":\"nnrwrbiork\",\"type\":\"alywjhhgdn\"}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SapVirtualInstance response = - manager - .sapVirtualInstances() - .getByResourceGroupWithResponse("ctkahzov", "jjziuxxpsh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uo", response.location()); - Assertions.assertEquals("nyfln", response.tags().get("rwm")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, response.environment()); - Assertions.assertEquals(SapProductType.ECC, response.sapProduct()); - Assertions.assertEquals("lqubkwdlen", response.managedResourceGroupConfiguration().name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupMockTests.java deleted file mode 100644 index 7b0f0a80841b..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapVirtualInstance; -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 SapVirtualInstancesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"ECC\",\"configuration\":{\"configurationType\":\"SapConfiguration\"},\"managedResourceGroupConfiguration\":{\"name\":\"dvoqyt\"},\"status\":\"SoftShutdown\",\"health\":\"Unknown\",\"state\":\"DiscoveryInProgress\",\"provisioningState\":\"Deleting\",\"errors\":{}},\"location\":\"utp\",\"tags\":{\"qolj\":\"oxoismsksbpim\",\"qzdwlvwlyoup\":\"kcgxxlxsffgcvi\"},\"id\":\"gfbkjubdyh\",\"name\":\"kfm\",\"type\":\"nsgowzfttst\"}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sapVirtualInstances().listByResourceGroup("n", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("utp", response.iterator().next().location()); - Assertions.assertEquals("oxoismsksbpim", response.iterator().next().tags().get("qolj")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, response.iterator().next().environment()); - Assertions.assertEquals(SapProductType.ECC, response.iterator().next().sapProduct()); - Assertions.assertEquals("dvoqyt", response.iterator().next().managedResourceGroupConfiguration().name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListMockTests.java deleted file mode 100644 index d466efd0918f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.SapEnvironmentType; -import com.azure.resourcemanager.workloads.models.SapProductType; -import com.azure.resourcemanager.workloads.models.SapVirtualInstance; -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 SapVirtualInstancesListMockTests { - @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\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{}},\"properties\":{\"environment\":\"NonProd\",\"sapProduct\":\"Other\",\"configuration\":{\"configurationType\":\"SapConfiguration\"},\"managedResourceGroupConfiguration\":{\"name\":\"ctxtgzukxi\"},\"status\":\"Running\",\"health\":\"Unknown\",\"state\":\"DiscoveryPending\",\"provisioningState\":\"Failed\",\"errors\":{}},\"location\":\"n\",\"tags\":{\"okqdzfvaz\":\"cpjuisa\",\"ajlkatnw\":\"vjlfrqtt\",\"kqqfk\":\"yiopi\",\"dmligovibrxk\":\"vscx\"},\"id\":\"mloazuru\",\"name\":\"cbgoor\",\"type\":\"te\"}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.sapVirtualInstances().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("n", response.iterator().next().location()); - Assertions.assertEquals("cpjuisa", response.iterator().next().tags().get("okqdzfvaz")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals(SapEnvironmentType.NON_PROD, response.iterator().next().environment()); - Assertions.assertEquals(SapProductType.OTHER, response.iterator().next().sapProduct()); - Assertions.assertEquals("ctxtgzukxi", response.iterator().next().managedResourceGroupConfiguration().name()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartMockTests.java deleted file mode 100644 index af8f71c25b32..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.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 SapVirtualInstancesStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"lmywwtkgkxnyed\",\"name\":\"gyvudtjuewbc\",\"status\":\"hxuuwhcjyxccybvp\",\"percentComplete\":25.451988,\"startTime\":\"2021-11-06T02:11:56Z\",\"endTime\":\"2021-10-08T16:55:36Z\",\"operations\":[{\"id\":\"gwjplmag\",\"name\":\"cyohpfkyrkdbd\",\"status\":\"iogsjkmnwq\",\"percentComplete\":87.046394,\"startTime\":\"2021-02-25T14:14:23Z\",\"endTime\":\"2021-01-11T18:24:56Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager.sapVirtualInstances().start("ybfhjxa", "vvjgslor", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lmywwtkgkxnyed", response.id()); - Assertions.assertEquals("gyvudtjuewbc", response.name()); - Assertions.assertEquals("hxuuwhcjyxccybvp", response.status()); - Assertions.assertEquals(25.451988F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T02:11:56Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T16:55:36Z"), response.endTime()); - Assertions.assertEquals("gwjplmag", response.operations().get(0).id()); - Assertions.assertEquals("cyohpfkyrkdbd", response.operations().get(0).name()); - Assertions.assertEquals("iogsjkmnwq", response.operations().get(0).status()); - Assertions.assertEquals(87.046394F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T14:14:23Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T18:24:56Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopMockTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopMockTests.java deleted file mode 100644 index 782d97b36b0d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.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.workloads.WorkloadsManager; -import com.azure.resourcemanager.workloads.models.OperationStatusResult; -import com.azure.resourcemanager.workloads.models.StopRequest; -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 SapVirtualInstancesStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"lxlllchpo\",\"name\":\"zevwrdnhfukuv\",\"status\":\"jcswsmys\",\"percentComplete\":76.54017,\"startTime\":\"2021-02-12T04:05:52Z\",\"endTime\":\"2021-04-05T13:26:46Z\",\"operations\":[{\"id\":\"lerchpq\",\"name\":\"f\",\"status\":\"jbabwidf\",\"percentComplete\":79.4317,\"startTime\":\"2021-04-22T17:42:46Z\",\"endTime\":\"2021-09-11T11:25:54Z\",\"operations\":[]},{\"id\":\"yhkx\",\"name\":\"ddrihpf\",\"status\":\"oqcaaewdaomdj\",\"percentComplete\":43.005836,\"startTime\":\"2021-04-03T00:41:35Z\",\"endTime\":\"2021-01-28T01:59:23Z\",\"operations\":[]},{\"id\":\"sgeivsiy\",\"name\":\"kdncj\",\"status\":\"xonbzoggculapz\",\"percentComplete\":58.168156,\"startTime\":\"2021-08-05T01:58:35Z\",\"endTime\":\"2021-06-21T04:03:02Z\",\"operations\":[]},{\"id\":\"pnylb\",\"name\":\"ajlyjtlvofqzhv\",\"status\":\"cib\",\"percentComplete\":42.81506,\"startTime\":\"2021-04-11T00:27:16Z\",\"endTime\":\"2021-08-08T19:27:36Z\",\"operations\":[]}]}"; - - 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); - })); - - WorkloadsManager manager = - WorkloadsManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationStatusResult response = - manager - .sapVirtualInstances() - .stop( - "iacegfnmn", - "fpmvmemfnczd", - new StopRequest().withSoftStopTimeoutSeconds(419587084903782086L), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lxlllchpo", response.id()); - Assertions.assertEquals("zevwrdnhfukuv", response.name()); - Assertions.assertEquals("jcswsmys", response.status()); - Assertions.assertEquals(76.54017F, response.percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T04:05:52Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T13:26:46Z"), response.endTime()); - Assertions.assertEquals("lerchpq", response.operations().get(0).id()); - Assertions.assertEquals("f", response.operations().get(0).name()); - Assertions.assertEquals("jbabwidf", response.operations().get(0).status()); - Assertions.assertEquals(79.4317F, response.operations().get(0).percentComplete()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T17:42:46Z"), response.operations().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-11T11:25:54Z"), response.operations().get(0).endTime()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SharedStorageResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SharedStorageResourceNamesTests.java deleted file mode 100644 index 30b7b3881e83..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SharedStorageResourceNamesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SharedStorageResourceNames; -import org.junit.jupiter.api.Assertions; - -public final class SharedStorageResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SharedStorageResourceNames model = - BinaryData - .fromString( - "{\"sharedStorageAccountName\":\"mwctondzjluudfd\",\"sharedStorageAccountPrivateEndPointName\":\"gg\"}") - .toObject(SharedStorageResourceNames.class); - Assertions.assertEquals("mwctondzjluudfd", model.sharedStorageAccountName()); - Assertions.assertEquals("gg", model.sharedStorageAccountPrivateEndPointName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedStorageResourceNames model = - new SharedStorageResourceNames() - .withSharedStorageAccountName("mwctondzjluudfd") - .withSharedStorageAccountPrivateEndPointName("gg"); - model = BinaryData.fromObject(model).toObject(SharedStorageResourceNames.class); - Assertions.assertEquals("mwctondzjluudfd", model.sharedStorageAccountName()); - Assertions.assertEquals("gg", model.sharedStorageAccountPrivateEndPointName()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerCustomResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerCustomResourceNamesTests.java deleted file mode 100644 index ed5b03a05845..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerCustomResourceNamesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SingleServerCustomResourceNames; - -public final class SingleServerCustomResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SingleServerCustomResourceNames model = - BinaryData - .fromString("{\"namingPatternType\":\"SingleServerCustomResourceNames\"}") - .toObject(SingleServerCustomResourceNames.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SingleServerCustomResourceNames model = new SingleServerCustomResourceNames(); - model = BinaryData.fromObject(model).toObject(SingleServerCustomResourceNames.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerFullResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerFullResourceNamesTests.java deleted file mode 100644 index c71b7a359b9d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerFullResourceNamesTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.NetworkInterfaceResourceNames; -import com.azure.resourcemanager.workloads.models.SingleServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SingleServerFullResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SingleServerFullResourceNames model = - BinaryData - .fromString( - "{\"namingPatternType\":\"FullResourceName\",\"virtualMachine\":{\"vmName\":\"qztpp\",\"hostName\":\"o\",\"networkInterfaces\":[{\"networkInterfaceName\":\"jaltolmnc\"}],\"osDiskName\":\"obqwcsdbnwdcfh\",\"dataDiskNames\":{\"t\":[\"pfuvglsbjjca\",\"vxb\"],\"xqtvcofu\":[\"dut\",\"cormr\"],\"gdknnqv\":[\"lvkgju\"],\"s\":[\"znqntoru\",\"sgsahmkycgr\",\"uwjuetaeburuvdmo\"]}}}") - .toObject(SingleServerFullResourceNames.class); - Assertions.assertEquals("qztpp", model.virtualMachine().vmName()); - Assertions.assertEquals("o", model.virtualMachine().hostname()); - Assertions.assertEquals("jaltolmnc", model.virtualMachine().networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("obqwcsdbnwdcfh", model.virtualMachine().osDiskName()); - Assertions.assertEquals("pfuvglsbjjca", model.virtualMachine().dataDiskNames().get("t").get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SingleServerFullResourceNames model = - new SingleServerFullResourceNames() - .withVirtualMachine( - new VirtualMachineResourceNames() - .withVmName("qztpp") - .withHostname("o") - .withNetworkInterfaces( - Arrays.asList(new NetworkInterfaceResourceNames().withNetworkInterfaceName("jaltolmnc"))) - .withOsDiskName("obqwcsdbnwdcfh") - .withDataDiskNames( - mapOf( - "t", - Arrays.asList("pfuvglsbjjca", "vxb"), - "xqtvcofu", - Arrays.asList("dut", "cormr"), - "gdknnqv", - Arrays.asList("lvkgju"), - "s", - Arrays.asList("znqntoru", "sgsahmkycgr", "uwjuetaeburuvdmo")))); - model = BinaryData.fromObject(model).toObject(SingleServerFullResourceNames.class); - Assertions.assertEquals("qztpp", model.virtualMachine().vmName()); - Assertions.assertEquals("o", model.virtualMachine().hostname()); - Assertions.assertEquals("jaltolmnc", model.virtualMachine().networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("obqwcsdbnwdcfh", model.virtualMachine().osDiskName()); - Assertions.assertEquals("pfuvglsbjjca", model.virtualMachine().dataDiskNames().get("t").get(0)); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerRecommendationResultTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerRecommendationResultTests.java deleted file mode 100644 index c1a520e9fcf0..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SingleServerRecommendationResultTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SingleServerRecommendationResult; -import org.junit.jupiter.api.Assertions; - -public final class SingleServerRecommendationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SingleServerRecommendationResult model = - BinaryData - .fromString("{\"deploymentType\":\"SingleServer\",\"vmSku\":\"syocogjltdtbnnha\"}") - .toObject(SingleServerRecommendationResult.class); - Assertions.assertEquals("syocogjltdtbnnha", model.vmSku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SingleServerRecommendationResult model = new SingleServerRecommendationResult().withVmSku("syocogjltdtbnnha"); - model = BinaryData.fromObject(model).toObject(SingleServerRecommendationResult.class); - Assertions.assertEquals("syocogjltdtbnnha", model.vmSku()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SkipFileShareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SkipFileShareConfigurationTests.java deleted file mode 100644 index 6a849a30d98c..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SkipFileShareConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SkipFileShareConfiguration; - -public final class SkipFileShareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkipFileShareConfiguration model = - BinaryData.fromString("{\"configurationType\":\"Skip\"}").toObject(SkipFileShareConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkipFileShareConfiguration model = new SkipFileShareConfiguration(); - model = BinaryData.fromObject(model).toObject(SkipFileShareConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SoftwareConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SoftwareConfigurationTests.java deleted file mode 100644 index cb459c7e8f29..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/SoftwareConfigurationTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.SoftwareConfiguration; - -public final class SoftwareConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareConfiguration model = - BinaryData - .fromString("{\"softwareInstallationType\":\"SoftwareConfiguration\"}") - .toObject(SoftwareConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareConfiguration model = new SoftwareConfiguration(); - model = BinaryData.fromObject(model).toObject(SoftwareConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StopRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StopRequestTests.java deleted file mode 100644 index ee0acc790125..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StopRequestTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.StopRequest; -import org.junit.jupiter.api.Assertions; - -public final class StopRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StopRequest model = - BinaryData.fromString("{\"softStopTimeoutSeconds\":203566108787836432}").toObject(StopRequest.class); - Assertions.assertEquals(203566108787836432L, model.softStopTimeoutSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StopRequest model = new StopRequest().withSoftStopTimeoutSeconds(203566108787836432L); - model = BinaryData.fromObject(model).toObject(StopRequest.class); - Assertions.assertEquals(203566108787836432L, model.softStopTimeoutSeconds()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageConfigurationTests.java deleted file mode 100644 index 7d5914cedf35..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageConfigurationTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.FileShareConfiguration; -import com.azure.resourcemanager.workloads.models.StorageConfiguration; - -public final class StorageConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageConfiguration model = - BinaryData - .fromString("{\"transportFileShareConfiguration\":{\"configurationType\":\"FileShareConfiguration\"}}") - .toObject(StorageConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageConfiguration model = - new StorageConfiguration().withTransportFileShareConfiguration(new FileShareConfiguration()); - model = BinaryData.fromObject(model).toObject(StorageConfiguration.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageInformationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageInformationTests.java deleted file mode 100644 index fcbadd69733b..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/StorageInformationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.StorageInformation; - -public final class StorageInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageInformation model = BinaryData.fromString("{\"id\":\"z\"}").toObject(StorageInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageInformation model = new StorageInformation(); - model = BinaryData.fromObject(model).toObject(StorageInformation.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierConfigurationTests.java deleted file mode 100644 index ca2494fd2926..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierConfigurationTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ApplicationServerConfiguration; -import com.azure.resourcemanager.workloads.models.CentralServerConfiguration; -import com.azure.resourcemanager.workloads.models.DatabaseConfiguration; -import com.azure.resourcemanager.workloads.models.DiskConfiguration; -import com.azure.resourcemanager.workloads.models.FileShareConfiguration; -import com.azure.resourcemanager.workloads.models.HighAvailabilityConfiguration; -import com.azure.resourcemanager.workloads.models.NetworkConfiguration; -import com.azure.resourcemanager.workloads.models.SapDatabaseType; -import com.azure.resourcemanager.workloads.models.SapHighAvailabilityType; -import com.azure.resourcemanager.workloads.models.StorageConfiguration; -import com.azure.resourcemanager.workloads.models.ThreeTierConfiguration; -import com.azure.resourcemanager.workloads.models.ThreeTierCustomResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineConfiguration; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ThreeTierConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThreeTierConfiguration model = - BinaryData - .fromString( - "{\"deploymentType\":\"ThreeTier\",\"networkConfiguration\":{\"isSecondaryIpEnabled\":false},\"centralServer\":{\"subnetId\":\"pulpqblylsyxk\",\"virtualMachineConfiguration\":{\"vmSize\":\"jnsjervtiagxsd\"},\"instanceCount\":1291290959009471574},\"applicationServer\":{\"subnetId\":\"e\",\"virtualMachineConfiguration\":{\"vmSize\":\"psbzkfzbeyvpn\"},\"instanceCount\":3787214015941911197},\"databaseServer\":{\"databaseType\":\"DB2\",\"subnetId\":\"nvkjjxdxrbuukzcl\",\"virtualMachineConfiguration\":{\"vmSize\":\"wyhmlw\"},\"instanceCount\":4136836492530491965,\"diskConfiguration\":{\"diskVolumeConfigurations\":{}}},\"highAvailabilityConfig\":{\"highAvailabilityType\":\"AvailabilitySet\"},\"storageConfiguration\":{\"transportFileShareConfiguration\":{\"configurationType\":\"FileShareConfiguration\"}},\"customResourceNames\":{\"namingPatternType\":\"ThreeTierCustomResourceNames\"},\"appResourceGroup\":\"kwyfzqwhxxbuyqax\"}") - .toObject(ThreeTierConfiguration.class); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.appResourceGroup()); - Assertions.assertEquals(false, model.networkConfiguration().isSecondaryIpEnabled()); - Assertions.assertEquals("pulpqblylsyxk", model.centralServer().subnetId()); - Assertions.assertEquals("jnsjervtiagxsd", model.centralServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(1291290959009471574L, model.centralServer().instanceCount()); - Assertions.assertEquals("e", model.applicationServer().subnetId()); - Assertions.assertEquals("psbzkfzbeyvpn", model.applicationServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(3787214015941911197L, model.applicationServer().instanceCount()); - Assertions.assertEquals(SapDatabaseType.DB2, model.databaseServer().databaseType()); - Assertions.assertEquals("nvkjjxdxrbuukzcl", model.databaseServer().subnetId()); - Assertions.assertEquals("wyhmlw", model.databaseServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(4136836492530491965L, model.databaseServer().instanceCount()); - Assertions - .assertEquals( - SapHighAvailabilityType.AVAILABILITY_SET, model.highAvailabilityConfig().highAvailabilityType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreeTierConfiguration model = - new ThreeTierConfiguration() - .withAppResourceGroup("kwyfzqwhxxbuyqax") - .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(false)) - .withCentralServer( - new CentralServerConfiguration() - .withSubnetId("pulpqblylsyxk") - .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("jnsjervtiagxsd")) - .withInstanceCount(1291290959009471574L)) - .withApplicationServer( - new ApplicationServerConfiguration() - .withSubnetId("e") - .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("psbzkfzbeyvpn")) - .withInstanceCount(3787214015941911197L)) - .withDatabaseServer( - new DatabaseConfiguration() - .withDatabaseType(SapDatabaseType.DB2) - .withSubnetId("nvkjjxdxrbuukzcl") - .withVirtualMachineConfiguration(new VirtualMachineConfiguration().withVmSize("wyhmlw")) - .withInstanceCount(4136836492530491965L) - .withDiskConfiguration(new DiskConfiguration().withDiskVolumeConfigurations(mapOf()))) - .withHighAvailabilityConfig( - new HighAvailabilityConfiguration() - .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) - .withStorageConfiguration( - new StorageConfiguration().withTransportFileShareConfiguration(new FileShareConfiguration())) - .withCustomResourceNames(new ThreeTierCustomResourceNames()); - model = BinaryData.fromObject(model).toObject(ThreeTierConfiguration.class); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.appResourceGroup()); - Assertions.assertEquals(false, model.networkConfiguration().isSecondaryIpEnabled()); - Assertions.assertEquals("pulpqblylsyxk", model.centralServer().subnetId()); - Assertions.assertEquals("jnsjervtiagxsd", model.centralServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(1291290959009471574L, model.centralServer().instanceCount()); - Assertions.assertEquals("e", model.applicationServer().subnetId()); - Assertions.assertEquals("psbzkfzbeyvpn", model.applicationServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(3787214015941911197L, model.applicationServer().instanceCount()); - Assertions.assertEquals(SapDatabaseType.DB2, model.databaseServer().databaseType()); - Assertions.assertEquals("nvkjjxdxrbuukzcl", model.databaseServer().subnetId()); - Assertions.assertEquals("wyhmlw", model.databaseServer().virtualMachineConfiguration().vmSize()); - Assertions.assertEquals(4136836492530491965L, model.databaseServer().instanceCount()); - Assertions - .assertEquals( - SapHighAvailabilityType.AVAILABILITY_SET, model.highAvailabilityConfig().highAvailabilityType()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierCustomResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierCustomResourceNamesTests.java deleted file mode 100644 index 9eedf60b44ff..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierCustomResourceNamesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ThreeTierCustomResourceNames; - -public final class ThreeTierCustomResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThreeTierCustomResourceNames model = - BinaryData - .fromString("{\"namingPatternType\":\"ThreeTierCustomResourceNames\"}") - .toObject(ThreeTierCustomResourceNames.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreeTierCustomResourceNames model = new ThreeTierCustomResourceNames(); - model = BinaryData.fromObject(model).toObject(ThreeTierCustomResourceNames.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierFullResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierFullResourceNamesTests.java deleted file mode 100644 index dbfea10df11e..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierFullResourceNamesTests.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ApplicationServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.CentralServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.DatabaseServerFullResourceNames; -import com.azure.resourcemanager.workloads.models.LoadBalancerResourceNames; -import com.azure.resourcemanager.workloads.models.SharedStorageResourceNames; -import com.azure.resourcemanager.workloads.models.ThreeTierFullResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ThreeTierFullResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThreeTierFullResourceNames model = - BinaryData - .fromString( - "{\"namingPatternType\":\"FullResourceName\",\"centralServer\":{\"virtualMachines\":[{\"vmName\":\"bykutw\",\"hostName\":\"hpagm\",\"networkInterfaces\":[],\"osDiskName\":\"kdsnfdsdoakgtdl\",\"dataDiskNames\":{}},{\"vmName\":\"zev\",\"hostName\":\"hewpusdsttwv\",\"networkInterfaces\":[],\"osDiskName\":\"bbejdcngqqm\",\"dataDiskNames\":{}},{\"vmName\":\"ufgmjzrwrdg\",\"hostName\":\"wae\",\"networkInterfaces\":[],\"osDiskName\":\"zkopb\",\"dataDiskNames\":{}}],\"availabilitySetName\":\"rfdwoyu\",\"loadBalancer\":{\"loadBalancerName\":\"iuiefozbhdmsm\",\"frontendIpConfigurationNames\":[\"qhoftrmaequiah\",\"icslfaoq\"],\"backendPoolNames\":[\"yylhalnswhccsp\",\"kaivwit\",\"scywuggwoluhc\",\"bwemhairs\"],\"healthProbeNames\":[\"z\"]}},\"applicationServer\":{\"virtualMachines\":[{\"vmName\":\"eypqwdxggicccn\",\"hostName\":\"huexmk\",\"networkInterfaces\":[],\"osDiskName\":\"stvlzywemhzrnc\",\"dataDiskNames\":{}}],\"availabilitySetName\":\"clusiy\"},\"databaseServer\":{\"virtualMachines\":[{\"vmName\":\"ytguslf\",\"hostName\":\"dcygqukyhejhz\",\"networkInterfaces\":[],\"osDiskName\":\"gfpelolppvksrpqv\",\"dataDiskNames\":{}},{\"vmName\":\"raehtwdwrft\",\"hostName\":\"iby\",\"networkInterfaces\":[],\"osDiskName\":\"l\",\"dataDiskNames\":{}},{\"vmName\":\"hfwpracstwit\",\"hostName\":\"hevxcced\",\"networkInterfaces\":[],\"osDiskName\":\"md\",\"dataDiskNames\":{}},{\"vmName\":\"nwzxltjcv\",\"hostName\":\"ltiugcxnavv\",\"networkInterfaces\":[],\"osDiskName\":\"ibyqunyowxwlmdj\",\"dataDiskNames\":{}}],\"availabilitySetName\":\"fgbvfvpdbo\",\"loadBalancer\":{\"loadBalancerName\":\"izsjqlhkrr\",\"frontendIpConfigurationNames\":[\"eibq\",\"p\"],\"backendPoolNames\":[\"hvxndzwmkrefajpj\",\"rwkq\",\"yhgbijtjivfx\",\"sjabibs\"],\"healthProbeNames\":[\"awfsdjpvkvpbjxbk\",\"bzkdvn\",\"jabudurgkakmo\"]}},\"sharedStorage\":{\"sharedStorageAccountName\":\"jjklff\",\"sharedStorageAccountPrivateEndPointName\":\"ouw\"}}") - .toObject(ThreeTierFullResourceNames.class); - Assertions.assertEquals("bykutw", model.centralServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("hpagm", model.centralServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("kdsnfdsdoakgtdl", model.centralServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("rfdwoyu", model.centralServer().availabilitySetName()); - Assertions.assertEquals("iuiefozbhdmsm", model.centralServer().loadBalancer().loadBalancerName()); - Assertions - .assertEquals("qhoftrmaequiah", model.centralServer().loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("yylhalnswhccsp", model.centralServer().loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("z", model.centralServer().loadBalancer().healthProbeNames().get(0)); - Assertions.assertEquals("eypqwdxggicccn", model.applicationServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("huexmk", model.applicationServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("stvlzywemhzrnc", model.applicationServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("clusiy", model.applicationServer().availabilitySetName()); - Assertions.assertEquals("ytguslf", model.databaseServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("dcygqukyhejhz", model.databaseServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("gfpelolppvksrpqv", model.databaseServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("fgbvfvpdbo", model.databaseServer().availabilitySetName()); - Assertions.assertEquals("izsjqlhkrr", model.databaseServer().loadBalancer().loadBalancerName()); - Assertions.assertEquals("eibq", model.databaseServer().loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("hvxndzwmkrefajpj", model.databaseServer().loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("awfsdjpvkvpbjxbk", model.databaseServer().loadBalancer().healthProbeNames().get(0)); - Assertions.assertEquals("jjklff", model.sharedStorage().sharedStorageAccountName()); - Assertions.assertEquals("ouw", model.sharedStorage().sharedStorageAccountPrivateEndPointName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreeTierFullResourceNames model = - new ThreeTierFullResourceNames() - .withCentralServer( - new CentralServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("bykutw") - .withHostname("hpagm") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("kdsnfdsdoakgtdl") - .withDataDiskNames(mapOf()), - new VirtualMachineResourceNames() - .withVmName("zev") - .withHostname("hewpusdsttwv") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("bbejdcngqqm") - .withDataDiskNames(mapOf()), - new VirtualMachineResourceNames() - .withVmName("ufgmjzrwrdg") - .withHostname("wae") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("zkopb") - .withDataDiskNames(mapOf()))) - .withAvailabilitySetName("rfdwoyu") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("iuiefozbhdmsm") - .withFrontendIpConfigurationNames(Arrays.asList("qhoftrmaequiah", "icslfaoq")) - .withBackendPoolNames( - Arrays.asList("yylhalnswhccsp", "kaivwit", "scywuggwoluhc", "bwemhairs")) - .withHealthProbeNames(Arrays.asList("z")))) - .withApplicationServer( - new ApplicationServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("eypqwdxggicccn") - .withHostname("huexmk") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("stvlzywemhzrnc") - .withDataDiskNames(mapOf()))) - .withAvailabilitySetName("clusiy")) - .withDatabaseServer( - new DatabaseServerFullResourceNames() - .withVirtualMachines( - Arrays - .asList( - new VirtualMachineResourceNames() - .withVmName("ytguslf") - .withHostname("dcygqukyhejhz") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("gfpelolppvksrpqv") - .withDataDiskNames(mapOf()), - new VirtualMachineResourceNames() - .withVmName("raehtwdwrft") - .withHostname("iby") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("l") - .withDataDiskNames(mapOf()), - new VirtualMachineResourceNames() - .withVmName("hfwpracstwit") - .withHostname("hevxcced") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("md") - .withDataDiskNames(mapOf()), - new VirtualMachineResourceNames() - .withVmName("nwzxltjcv") - .withHostname("ltiugcxnavv") - .withNetworkInterfaces(Arrays.asList()) - .withOsDiskName("ibyqunyowxwlmdj") - .withDataDiskNames(mapOf()))) - .withAvailabilitySetName("fgbvfvpdbo") - .withLoadBalancer( - new LoadBalancerResourceNames() - .withLoadBalancerName("izsjqlhkrr") - .withFrontendIpConfigurationNames(Arrays.asList("eibq", "p")) - .withBackendPoolNames( - Arrays.asList("hvxndzwmkrefajpj", "rwkq", "yhgbijtjivfx", "sjabibs")) - .withHealthProbeNames(Arrays.asList("awfsdjpvkvpbjxbk", "bzkdvn", "jabudurgkakmo")))) - .withSharedStorage( - new SharedStorageResourceNames() - .withSharedStorageAccountName("jjklff") - .withSharedStorageAccountPrivateEndPointName("ouw")); - model = BinaryData.fromObject(model).toObject(ThreeTierFullResourceNames.class); - Assertions.assertEquals("bykutw", model.centralServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("hpagm", model.centralServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("kdsnfdsdoakgtdl", model.centralServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("rfdwoyu", model.centralServer().availabilitySetName()); - Assertions.assertEquals("iuiefozbhdmsm", model.centralServer().loadBalancer().loadBalancerName()); - Assertions - .assertEquals("qhoftrmaequiah", model.centralServer().loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("yylhalnswhccsp", model.centralServer().loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("z", model.centralServer().loadBalancer().healthProbeNames().get(0)); - Assertions.assertEquals("eypqwdxggicccn", model.applicationServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("huexmk", model.applicationServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("stvlzywemhzrnc", model.applicationServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("clusiy", model.applicationServer().availabilitySetName()); - Assertions.assertEquals("ytguslf", model.databaseServer().virtualMachines().get(0).vmName()); - Assertions.assertEquals("dcygqukyhejhz", model.databaseServer().virtualMachines().get(0).hostname()); - Assertions.assertEquals("gfpelolppvksrpqv", model.databaseServer().virtualMachines().get(0).osDiskName()); - Assertions.assertEquals("fgbvfvpdbo", model.databaseServer().availabilitySetName()); - Assertions.assertEquals("izsjqlhkrr", model.databaseServer().loadBalancer().loadBalancerName()); - Assertions.assertEquals("eibq", model.databaseServer().loadBalancer().frontendIpConfigurationNames().get(0)); - Assertions.assertEquals("hvxndzwmkrefajpj", model.databaseServer().loadBalancer().backendPoolNames().get(0)); - Assertions.assertEquals("awfsdjpvkvpbjxbk", model.databaseServer().loadBalancer().healthProbeNames().get(0)); - Assertions.assertEquals("jjklff", model.sharedStorage().sharedStorageAccountName()); - Assertions.assertEquals("ouw", model.sharedStorage().sharedStorageAccountPrivateEndPointName()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierRecommendationResultTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierRecommendationResultTests.java deleted file mode 100644 index f58be2c18b7a..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/ThreeTierRecommendationResultTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ThreeTierRecommendationResult; -import org.junit.jupiter.api.Assertions; - -public final class ThreeTierRecommendationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThreeTierRecommendationResult model = - BinaryData - .fromString( - "{\"deploymentType\":\"ThreeTier\",\"dbVmSku\":\"ocrkvcikh\",\"databaseInstanceCount\":191719140386438255,\"centralServerVmSku\":\"qgxqquezikyw\",\"centralServerInstanceCount\":5773769686889892375,\"applicationServerVmSku\":\"lla\",\"applicationServerInstanceCount\":8033658748454090244}") - .toObject(ThreeTierRecommendationResult.class); - Assertions.assertEquals("ocrkvcikh", model.dbVmSku()); - Assertions.assertEquals(191719140386438255L, model.databaseInstanceCount()); - Assertions.assertEquals("qgxqquezikyw", model.centralServerVmSku()); - Assertions.assertEquals(5773769686889892375L, model.centralServerInstanceCount()); - Assertions.assertEquals("lla", model.applicationServerVmSku()); - Assertions.assertEquals(8033658748454090244L, model.applicationServerInstanceCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreeTierRecommendationResult model = - new ThreeTierRecommendationResult() - .withDbVmSku("ocrkvcikh") - .withDatabaseInstanceCount(191719140386438255L) - .withCentralServerVmSku("qgxqquezikyw") - .withCentralServerInstanceCount(5773769686889892375L) - .withApplicationServerVmSku("lla") - .withApplicationServerInstanceCount(8033658748454090244L); - model = BinaryData.fromObject(model).toObject(ThreeTierRecommendationResult.class); - Assertions.assertEquals("ocrkvcikh", model.dbVmSku()); - Assertions.assertEquals(191719140386438255L, model.databaseInstanceCount()); - Assertions.assertEquals("qgxqquezikyw", model.centralServerVmSku()); - Assertions.assertEquals(5773769686889892375L, model.centralServerInstanceCount()); - Assertions.assertEquals("lla", model.applicationServerVmSku()); - Assertions.assertEquals(8033658748454090244L, model.applicationServerInstanceCount()); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateMonitorRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateMonitorRequestTests.java deleted file mode 100644 index d76f4ece8d5f..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateMonitorRequestTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.UpdateMonitorRequest; -import com.azure.resourcemanager.workloads.models.UserAssignedIdentity; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateMonitorRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateMonitorRequest model = - BinaryData - .fromString( - "{\"tags\":{\"hxsrzdzucersc\":\"lylpstdb\",\"iwjmygtdssls\":\"ntnev\",\"emwabnet\":\"tmweriofzpyq\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"d\":{\"principalId\":\"ba4e8e39-4d8c-4df0-b474-6268ebc19ff0\",\"clientId\":\"50d09aa1-837a-439d-add4-f29214d450e6\"},\"wiwubm\":{\"principalId\":\"09559181-9d20-4838-9e28-54d4d59aee1e\",\"clientId\":\"01af568c-3304-49cf-85c1-074a846dc298\"},\"esl\":{\"principalId\":\"0c3d2754-8972-4cc2-89ba-d0e7e6ea1587\",\"clientId\":\"195f9248-d5fe-44c5-8b71-e48a9c776924\"}}}}") - .toObject(UpdateMonitorRequest.class); - Assertions.assertEquals("lylpstdb", model.tags().get("hxsrzdzucersc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateMonitorRequest model = - new UpdateMonitorRequest() - .withTags(mapOf("hxsrzdzucersc", "lylpstdb", "iwjmygtdssls", "ntnev", "emwabnet", "tmweriofzpyq")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "d", - new UserAssignedIdentity(), - "wiwubm", - new UserAssignedIdentity(), - "esl", - new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(UpdateMonitorRequest.class); - Assertions.assertEquals("lylpstdb", model.tags().get("hxsrzdzucersc")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapApplicationInstanceRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapApplicationInstanceRequestTests.java deleted file mode 100644 index 053da935a334..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapApplicationInstanceRequestTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.UpdateSapApplicationInstanceRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateSapApplicationInstanceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateSapApplicationInstanceRequest model = - BinaryData - .fromString("{\"tags\":{\"i\":\"fwxosowzxcu\",\"ucww\":\"jooxdjebw\",\"bvmeuecivy\":\"vo\"}}") - .toObject(UpdateSapApplicationInstanceRequest.class); - Assertions.assertEquals("fwxosowzxcu", model.tags().get("i")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSapApplicationInstanceRequest model = - new UpdateSapApplicationInstanceRequest() - .withTags(mapOf("i", "fwxosowzxcu", "ucww", "jooxdjebw", "bvmeuecivy", "vo")); - model = BinaryData.fromObject(model).toObject(UpdateSapApplicationInstanceRequest.class); - Assertions.assertEquals("fwxosowzxcu", model.tags().get("i")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapCentralInstanceRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapCentralInstanceRequestTests.java deleted file mode 100644 index d4ece93185f5..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapCentralInstanceRequestTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.UpdateSapCentralInstanceRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateSapCentralInstanceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateSapCentralInstanceRequest model = - BinaryData - .fromString( - "{\"tags\":{\"utqxlngx\":\"vtpgvdfgiotkf\",\"xdqmidtthzrvqdra\":\"efgugnxk\",\"skanyk\":\"hjybigehoqfbo\"}}") - .toObject(UpdateSapCentralInstanceRequest.class); - Assertions.assertEquals("vtpgvdfgiotkf", model.tags().get("utqxlngx")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSapCentralInstanceRequest model = - new UpdateSapCentralInstanceRequest() - .withTags( - mapOf("utqxlngx", "vtpgvdfgiotkf", "xdqmidtthzrvqdra", "efgugnxk", "skanyk", "hjybigehoqfbo")); - model = BinaryData.fromObject(model).toObject(UpdateSapCentralInstanceRequest.class); - Assertions.assertEquals("vtpgvdfgiotkf", model.tags().get("utqxlngx")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapDatabaseInstanceRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapDatabaseInstanceRequestTests.java deleted file mode 100644 index 84814662c39e..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapDatabaseInstanceRequestTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.UpdateSapDatabaseInstanceRequest; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateSapDatabaseInstanceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateSapDatabaseInstanceRequest model = - BinaryData - .fromString("{\"tags\":{\"rmjmwvvjektc\":\"kbeype\",\"frzpwvlqdqgb\":\"senhwlrs\"}}") - .toObject(UpdateSapDatabaseInstanceRequest.class); - Assertions.assertEquals("kbeype", model.tags().get("rmjmwvvjektc")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSapDatabaseInstanceRequest model = - new UpdateSapDatabaseInstanceRequest() - .withTags(mapOf("rmjmwvvjektc", "kbeype", "frzpwvlqdqgb", "senhwlrs")); - model = BinaryData.fromObject(model).toObject(UpdateSapDatabaseInstanceRequest.class); - Assertions.assertEquals("kbeype", model.tags().get("rmjmwvvjektc")); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapVirtualInstanceRequestTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapVirtualInstanceRequestTests.java deleted file mode 100644 index 2a03fbb7f6b1..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UpdateSapVirtualInstanceRequestTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.UpdateSapVirtualInstanceRequest; -import com.azure.resourcemanager.workloads.models.UserAssignedIdentity; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateSapVirtualInstanceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateSapVirtualInstanceRequest model = - BinaryData - .fromString( - "{\"tags\":{\"vwryoqpso\":\"odjpslwejd\",\"yffdfdos\":\"cctazakljlahbc\"},\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"jakhmsbzjh\":{\"principalId\":\"9d604921-29ee-4ba8-be56-842b27d69af8\",\"clientId\":\"6e418b5f-eb54-41b3-9a83-9141b36ce003\"},\"evdphlxaol\":{\"principalId\":\"5f0b6d05-6f12-44c1-96a2-42b470fadbef\",\"clientId\":\"bd163123-e6d1-44cb-939d-44e990e51e71\"},\"trg\":{\"principalId\":\"5c599304-e05a-43d8-8a50-992a7e395cd7\",\"clientId\":\"895a0f27-8b2d-4117-86ef-445a4b08d29c\"},\"pfzfsinzgvfc\":{\"principalId\":\"538284bc-d318-4f26-ac3c-38862d9526a5\",\"clientId\":\"418dbaf5-7408-4964-a8a1-2e6b1de71ea8\"}}}}") - .toObject(UpdateSapVirtualInstanceRequest.class); - Assertions.assertEquals("odjpslwejd", model.tags().get("vwryoqpso")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateSapVirtualInstanceRequest model = - new UpdateSapVirtualInstanceRequest() - .withTags(mapOf("vwryoqpso", "odjpslwejd", "yffdfdos", "cctazakljlahbc")) - .withIdentity( - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "jakhmsbzjh", - new UserAssignedIdentity(), - "evdphlxaol", - new UserAssignedIdentity(), - "trg", - new UserAssignedIdentity(), - "pfzfsinzgvfc", - new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(UpdateSapVirtualInstanceRequest.class); - Assertions.assertEquals("odjpslwejd", model.tags().get("vwryoqpso")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedIdentityTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 85d61883aa8d..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"42f4a319-031c-483a-93f2-6c9c280b02e0\",\"clientId\":\"270bb94e-2e6d-4ef9-aaed-9f2530e446a9\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedServiceIdentityTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedServiceIdentityTests.java deleted file mode 100644 index 35b6ea78bbcb..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/UserAssignedServiceIdentityTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.workloads.models.UserAssignedIdentity; -import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UserAssignedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedServiceIdentity model = - BinaryData - .fromString( - "{\"type\":\"None\",\"userAssignedIdentities\":{\"eho\":{\"principalId\":\"4ced0614-bd0a-47f5-b199-355f5f357d7f\",\"clientId\":\"ba48814b-9176-46af-8c04-be04ce3edb9d\"}}}") - .toObject(UserAssignedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedServiceIdentity model = - new UserAssignedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("eho", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(UserAssignedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.type()); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/VirtualMachineResourceNamesTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/VirtualMachineResourceNamesTests.java deleted file mode 100644 index 373409c33cf6..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/VirtualMachineResourceNamesTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.NetworkInterfaceResourceNames; -import com.azure.resourcemanager.workloads.models.VirtualMachineResourceNames; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class VirtualMachineResourceNamesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualMachineResourceNames model = - BinaryData - .fromString( - "{\"vmName\":\"l\",\"hostName\":\"ab\",\"networkInterfaces\":[{\"networkInterfaceName\":\"fkifr\"},{\"networkInterfaceName\":\"puqujmqlgkfbtn\"}],\"osDiskName\":\"aongbj\",\"dataDiskNames\":{\"ybxarzgszu\":[\"jitcjedftwwaez\",\"ojvdcpzfoqo\",\"i\"],\"szzcmrvexztv\":[\"x\",\"iqopidoamciod\",\"khazxkhnzbonlwn\",\"oegokdwbwh\"],\"lmnguxaw\":[\"qgsfraoyzkoow\"]}}") - .toObject(VirtualMachineResourceNames.class); - Assertions.assertEquals("l", model.vmName()); - Assertions.assertEquals("ab", model.hostname()); - Assertions.assertEquals("fkifr", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("aongbj", model.osDiskName()); - Assertions.assertEquals("jitcjedftwwaez", model.dataDiskNames().get("ybxarzgszu").get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualMachineResourceNames model = - new VirtualMachineResourceNames() - .withVmName("l") - .withHostname("ab") - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfaceResourceNames().withNetworkInterfaceName("fkifr"), - new NetworkInterfaceResourceNames().withNetworkInterfaceName("puqujmqlgkfbtn"))) - .withOsDiskName("aongbj") - .withDataDiskNames( - mapOf( - "ybxarzgszu", - Arrays.asList("jitcjedftwwaez", "ojvdcpzfoqo", "i"), - "szzcmrvexztv", - Arrays.asList("x", "iqopidoamciod", "khazxkhnzbonlwn", "oegokdwbwh"), - "lmnguxaw", - Arrays.asList("qgsfraoyzkoow"))); - model = BinaryData.fromObject(model).toObject(VirtualMachineResourceNames.class); - Assertions.assertEquals("l", model.vmName()); - Assertions.assertEquals("ab", model.hostname()); - Assertions.assertEquals("fkifr", model.networkInterfaces().get(0).networkInterfaceName()); - Assertions.assertEquals("aongbj", model.osDiskName()); - Assertions.assertEquals("jitcjedftwwaez", model.dataDiskNames().get("ybxarzgszu").get(0)); - } - - @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/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/WindowsConfigurationTests.java b/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/WindowsConfigurationTests.java deleted file mode 100644 index 7b0671105b39..000000000000 --- a/sdk/workloads/azure-resourcemanager-workloads/src/test/java/com/azure/resourcemanager/workloads/generated/WindowsConfigurationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.workloads.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.workloads.models.WindowsConfiguration; - -public final class WindowsConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WindowsConfiguration model = - BinaryData.fromString("{\"osType\":\"Windows\"}").toObject(WindowsConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WindowsConfiguration model = new WindowsConfiguration(); - model = BinaryData.fromObject(model).toObject(WindowsConfiguration.class); - } -}