diff --git a/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md b/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md index c72e52791775..16d89e1260fa 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md +++ b/sdk/workloads/azure-resourcemanager-workloads/CHANGELOG.md @@ -1,5 +1,6 @@ # Release History -## 1.0.0-beta.1 (2022-05-16) +## 1.0.0-beta.1 (2022-05-26) - 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-2021-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + diff --git a/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md b/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md index 8d27261b6cd2..3ceba09692e3 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md +++ b/sdk/workloads/azure-resourcemanager-workloads/SAMPLE.md @@ -14,12 +14,74 @@ - [List](#operations_list) +## PhpWorkloads + +- [CreateOrUpdate](#phpworkloads_createorupdate) +- [Delete](#phpworkloads_delete) +- [GetByResourceGroup](#phpworkloads_getbyresourcegroup) +- [List](#phpworkloads_list) +- [ListByResourceGroup](#phpworkloads_listbyresourcegroup) +- [Update](#phpworkloads_update) + ## ProviderInstances - [Create](#providerinstances_create) - [Delete](#providerinstances_delete) - [Get](#providerinstances_get) - [List](#providerinstances_list) + +## ResourceProvider + +- [SapAvailabilityZoneDetails](#resourceprovider_sapavailabilityzonedetails) +- [SapDiskConfigurations](#resourceprovider_sapdiskconfigurations) +- [SapSizingRecommendations](#resourceprovider_sapsizingrecommendations) +- [SapSupportedSku](#resourceprovider_sapsupportedsku) + +## SapApplicationServerInstances + +- [Create](#sapapplicationserverinstances_create) +- [Delete](#sapapplicationserverinstances_delete) +- [Get](#sapapplicationserverinstances_get) +- [List](#sapapplicationserverinstances_list) +- [Update](#sapapplicationserverinstances_update) + +## SapCentralInstances + +- [Create](#sapcentralinstances_create) +- [Delete](#sapcentralinstances_delete) +- [Get](#sapcentralinstances_get) +- [List](#sapcentralinstances_list) +- [Update](#sapcentralinstances_update) + +## SapDatabaseInstances + +- [Create](#sapdatabaseinstances_create) +- [Delete](#sapdatabaseinstances_delete) +- [Get](#sapdatabaseinstances_get) +- [List](#sapdatabaseinstances_list) +- [Update](#sapdatabaseinstances_update) + +## SapVirtualInstances + +- [Create](#sapvirtualinstances_create) +- [Delete](#sapvirtualinstances_delete) +- [GetByResourceGroup](#sapvirtualinstances_getbyresourcegroup) +- [List](#sapvirtualinstances_list) +- [ListByResourceGroup](#sapvirtualinstances_listbyresourcegroup) +- [Start](#sapvirtualinstances_start) +- [Stop](#sapvirtualinstances_stop) +- [Update](#sapvirtualinstances_update) + +## Skus + +- [List](#skus_list) + +## WordpressInstances + +- [CreateOrUpdate](#wordpressinstances_createorupdate) +- [Delete](#wordpressinstances_delete) +- [Get](#wordpressinstances_get) +- [List](#wordpressinstances_list) ### Monitors_Create ```java @@ -34,7 +96,7 @@ public final class MonitorsCreateSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Create.json */ /** - * Sample code: Create a SAP Monitor. + * Sample code: Create a SAP monitor. * * @param manager Entry point to WorkloadsManager. */ @@ -121,7 +183,7 @@ public final class MonitorsListSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_List.json */ /** - * Sample code: List all SAP Monitors in a subscription. + * Sample code: List all SAP monitors in a subscription. * * @param manager Entry point to WorkloadsManager. */ @@ -142,7 +204,7 @@ public final class MonitorsListByResourceGroupSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_ListByRG.json */ /** - * Sample code: List all SAP Monitors in a resource group. + * Sample code: List all SAP monitors in a resource group. * * @param manager Entry point to WorkloadsManager. */ @@ -231,6 +293,280 @@ public final class OperationsListSamples { } ``` +### PhpWorkloads_CreateOrUpdate + +```java +import com.azure.resourcemanager.workloads.models.AzureFrontDoorEnabled; +import com.azure.resourcemanager.workloads.models.BackupProfile; +import com.azure.resourcemanager.workloads.models.CacheProfile; +import com.azure.resourcemanager.workloads.models.DatabaseProfile; +import com.azure.resourcemanager.workloads.models.DatabaseTier; +import com.azure.resourcemanager.workloads.models.DatabaseType; +import com.azure.resourcemanager.workloads.models.DiskInfo; +import com.azure.resourcemanager.workloads.models.DiskStorageType; +import com.azure.resourcemanager.workloads.models.EnableBackup; +import com.azure.resourcemanager.workloads.models.EnableSslEnforcement; +import com.azure.resourcemanager.workloads.models.FileShareStorageType; +import com.azure.resourcemanager.workloads.models.FileShareType; +import com.azure.resourcemanager.workloads.models.FileshareProfile; +import com.azure.resourcemanager.workloads.models.HAEnabled; +import com.azure.resourcemanager.workloads.models.LoadBalancerType; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkProfile; +import com.azure.resourcemanager.workloads.models.NodeProfile; +import com.azure.resourcemanager.workloads.models.OSImageOffer; +import com.azure.resourcemanager.workloads.models.OSImagePublisher; +import com.azure.resourcemanager.workloads.models.OSImageSku; +import com.azure.resourcemanager.workloads.models.OSImageVersion; +import com.azure.resourcemanager.workloads.models.OsImageProfile; +import com.azure.resourcemanager.workloads.models.PhpProfile; +import com.azure.resourcemanager.workloads.models.PhpVersion; +import com.azure.resourcemanager.workloads.models.RedisCacheFamily; +import com.azure.resourcemanager.workloads.models.SearchProfile; +import com.azure.resourcemanager.workloads.models.SearchType; +import com.azure.resourcemanager.workloads.models.SiteProfile; +import com.azure.resourcemanager.workloads.models.Sku; +import com.azure.resourcemanager.workloads.models.UserProfile; +import com.azure.resourcemanager.workloads.models.VmssNodesProfile; +import com.azure.resourcemanager.workloads.models.WorkloadKind; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PhpWorkloads CreateOrUpdate. */ +public final class PhpWorkloadsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_CreateOrUpdate.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager + .phpWorkloads() + .define("wp39") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withKind(WorkloadKind.WORD_PRESS) + .withTags(mapOf()) + .withSku(new Sku().withName("Large")) + .withAppLocation("eastus") + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("php-mrg-wp39")) + .withAdminUserProfile(new UserProfile().withUsername("wpadmin").withSshPublicKey("===SSH=PUBLIC=KEY===")) + .withWebNodesProfile( + new VmssNodesProfile() + .withName("web-server") + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withAutoScaleMinCount(1) + .withAutoScaleMaxCount(1)) + .withControllerProfile( + new NodeProfile() + .withName("contoller-vm") + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withDataDisks( + Arrays.asList(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS).withSizeInGB(100L)))) + .withNetworkProfile( + new NetworkProfile() + .withLoadBalancerType(LoadBalancerType.LOAD_BALANCER) + .withLoadBalancerSku("Standard") + .withAzureFrontDoorEnabled(AzureFrontDoorEnabled.ENABLED)) + .withDatabaseProfile( + new DatabaseProfile() + .withType(DatabaseType.MY_SQL) + .withServerName("wp-db-server") + .withVersion("5.7") + .withSku("Standard_D32s_v4") + .withTier(DatabaseTier.GENERAL_PURPOSE) + .withHaEnabled(HAEnabled.DISABLED) + .withStorageSku("Premium_LRS") + .withStorageInGB(128L) + .withStorageIops(200L) + .withBackupRetentionDays(7) + .withSslEnforcementEnabled(EnableSslEnforcement.ENABLED)) + .withSiteProfile(new SiteProfile().withDomainName("www.example.com")) + .withFileshareProfile( + new FileshareProfile() + .withShareType(FileShareType.AZURE_FILES) + .withStorageType(FileShareStorageType.PREMIUM_LRS) + .withShareSizeInGB(100L)) + .withPhpProfile(new PhpProfile().withVersion(PhpVersion.SEVEN_THREE)) + .withSearchProfile( + new SearchProfile() + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withSearchType(SearchType.ELASTIC)) + .withCacheProfile( + new CacheProfile() + .withName("wp-cache") + .withSkuName("Basic") + .withFamily(RedisCacheFamily.C) + .withCapacity(0L)) + .withBackupProfile(new BackupProfile().withBackupEnabled(EnableBackup.DISABLED)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PhpWorkloads_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads Delete. */ +public final class PhpWorkloadsDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Delete.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().delete("test-rg", "wp39", "false", Context.NONE); + } +} +``` + +### PhpWorkloads_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads GetByResourceGroup. */ +public final class PhpWorkloadsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Get.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().getByResourceGroupWithResponse("test-rg", "wp39", Context.NONE); + } +} +``` + +### PhpWorkloads_List + +```java +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads List. */ +public final class PhpWorkloadsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListBySubscription.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().list(Context.NONE); + } +} +``` + +### PhpWorkloads_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads ListByResourceGroup. */ +public final class PhpWorkloadsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListByResourceGroup.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### PhpWorkloads_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBodyIdentity; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PhpWorkloads Update. */ +public final class PhpWorkloadsUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Update.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + PhpWorkloadResource resource = + manager.phpWorkloads().getByResourceGroupWithResponse("test-rg", "wp39", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag_name", "tag_value")) + .withIdentity(new PatchResourceRequestBodyIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### ProviderInstances_Create ```java @@ -245,82 +581,53 @@ import java.util.Arrays; /** Samples for ProviderInstances Create. */ public final class ProviderInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create.json + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json */ /** - * Sample code: Create a SAP Monitor Hana provider. + * Sample code: Create a MsSqlServer provider. * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager .providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") .withDbUsername("user") .withDbPassword("****") .withDbPasswordUri("") - .withDbSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslHostnameInCertificate("xyz.domain.com")) - .create(); - } - - /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() - .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("****") - .withSapPasswordUri("") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSapSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withSapSid("sid")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create.json */ /** - * Sample code: Create a MsSqlServer provider. + * Sample code: Create a SAP monitor Hana provider. * * @param manager Entry point to WorkloadsManager. */ - public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager .providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") .withDbUsername("user") .withDbPassword("****") .withDbPasswordUri("") - .withSapSid("sid")) + .withDbSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com")) .create(); } @@ -389,6 +696,35 @@ public final class ProviderInstancesCreateSamples { new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics")) .create(); } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .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("****") + .withSapPasswordUri("") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSapSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } } ``` @@ -521,7 +857,7 @@ public final class ProviderInstancesListSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_List.json */ /** - * Sample code: List all SAP Monitors providers in a subscription. + * Sample code: List all SAP monitors providers in a subscription. * * @param manager Entry point to WorkloadsManager. */ @@ -532,3 +868,1725 @@ public final class ProviderInstancesListSamples { } ``` +### ResourceProvider_SapAvailabilityZoneDetails + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +public final class ResourceProviderSapAvailabilityZoneDetailsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } +} +``` + +### ResourceProvider_SapDiskConfigurations + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapDiskConfigurations. */ +public final class ResourceProviderSapDiskConfigurationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } +} +``` + +### ResourceProvider_SapSizingRecommendations + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapSizingRecommendations. */ +public final class ResourceProviderSapSizingRecommendationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } +} +``` + +### ResourceProvider_SapSupportedSku + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapSupportedSku. */ +public final class ResourceProviderSapSupportedSkuSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Create. */ +public final class SapApplicationServerInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("app01") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapApplicationServerInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances Delete. */ +public final class SapApplicationServerInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances Get. */ +public final class SapApplicationServerInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "app01", Context.NONE); + } +} +``` + +### SapApplicationServerInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances List. */ +public final class SapApplicationServerInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapApplicationServerInstances().list("test-rg", "X00", Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Update. */ +public final class SapApplicationServerInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapCentralInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Create. */ +public final class SapCentralInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("centralServer") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapCentralInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances Delete. */ +public final class SapCentralInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapCentralInstances().delete("test-rg", "X00", "centralServer", Context.NONE); + } +} +``` + +### SapCentralInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances Get. */ +public final class SapCentralInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "centralServer", Context.NONE); + } +} +``` + +### SapCentralInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances List. */ +public final class SapCentralInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapCentralInstances().list("test-rg", "X00", Context.NONE); + } +} +``` + +### SapCentralInstances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Update. */ +public final class SapCentralInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapDatabaseInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Create. */ +public final class SapDatabaseInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("databaseServer") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapDatabaseInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances Delete. */ +public final class SapDatabaseInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapDatabaseInstances().delete("test-rg", "X00", "databaseServer", Context.NONE); + } +} +``` + +### SapDatabaseInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances Get. */ +public final class SapDatabaseInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "databaseServer", Context.NONE); + } +} +``` + +### SapDatabaseInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances List. */ +public final class SapDatabaseInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapDatabaseInstances().list("test-rg", "X00", Context.NONE); + } +} +``` + +### SapDatabaseInstances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Update. */ +public final class SapDatabaseInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("key1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapVirtualInstances_Create + +```java +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.DeployerVmPackages; +import com.azure.resourcemanager.workloads.models.DeploymentConfiguration; +import com.azure.resourcemanager.workloads.models.DeploymentWithOSConfiguration; +import com.azure.resourcemanager.workloads.models.HighAvailabilityConfiguration; +import com.azure.resourcemanager.workloads.models.ImageReference; +import com.azure.resourcemanager.workloads.models.LinuxConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkConfiguration; +import com.azure.resourcemanager.workloads.models.OSProfile; +import com.azure.resourcemanager.workloads.models.OsSapConfiguration; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +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.SingleServerConfiguration; +import com.azure.resourcemanager.workloads.models.SshConfiguration; +import com.azure.resourcemanager.workloads.models.SshKeyPair; +import com.azure.resourcemanager.workloads.models.SshPublicKey; +import com.azure.resourcemanager.workloads.models.ThreeTierConfiguration; +import com.azure.resourcemanager.workloads.models.VirtualMachineConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Create. */ +public final class SapVirtualInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_HA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigHAAvSet( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_HA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigHAAvZone( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + */ + /** + * Sample code: SAPVirtualInstances_Create_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateDistributed( + 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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(1L)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + */ + /** + * Sample code: SAPVirtualInstances_Create_HA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateHAAvZone(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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigSingleServer( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair().withPublicKey("abc").withPrivateKey("xyz")))))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + */ + /** + * Sample code: SAPVirtualInstances_Create_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateSingleServer( + 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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData("ssh-rsa public key"))))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + */ + /** + * Sample code: SAPVirtualInstances_Create_HA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateHAAvSet(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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(5L)) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigDistributed( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapVirtualInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances Delete. */ +public final class SapVirtualInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().delete("test-rg", "X00", Context.NONE); + } +} +``` + +### SapVirtualInstances_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances GetByResourceGroup. */ +public final class SapVirtualInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getByResourceGroupWithResponse("test-rg", "X00", Context.NONE); + } +} +``` + +### SapVirtualInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances List. */ +public final class SapVirtualInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().list(Context.NONE); + } +} +``` + +### SapVirtualInstances_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances ListByResourceGroup. */ +public final class SapVirtualInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().listByResourceGroup("test-rg", Context.NONE); + } +} +``` + +### SapVirtualInstances_Start + +```java +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances Start. */ +public final class SapVirtualInstancesStartSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().start("test-rg", "X00", Context.NONE); + } +} +``` + +### SapVirtualInstances_Stop + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.StopRequest; + +/** Samples for SapVirtualInstances Stop. */ +public final class SapVirtualInstancesStopSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().stop("test-rg", "X00", new StopRequest().withHardStop(false), Context.NONE); + } +} +``` + +### SapVirtualInstances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloads.models.SapVirtualInstance; +import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Update. */ +public final class SapVirtualInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key1", "svi1")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void skus(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.skus().list(Context.NONE); + } +} +``` + +### WordpressInstances_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.azure.resourcemanager.workloads.models.WordpressVersions; + +/** Samples for WordpressInstances CreateOrUpdate. */ +public final class WordpressInstancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_CreateOrUpdate.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager + .wordpressInstances() + .createOrUpdate( + "test-rg", + "wp39", + new WordpressInstanceResourceInner() + .withVersion(WordpressVersions.FIVE_FOUR_TWO) + .withDatabaseName("wpdb") + .withDatabaseUser("wpuser"), + Context.NONE); + } +} +``` + +### WordpressInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for WordpressInstances Delete. */ +public final class WordpressInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Delete.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().deleteWithResponse("test-rg", "wp39", Context.NONE); + } +} +``` + +### WordpressInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for WordpressInstances Get. */ +public final class WordpressInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Get.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().getWithResponse("test-rg", "wp39", Context.NONE); + } +} +``` + +### WordpressInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for WordpressInstances List. */ +public final class WordpressInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_List.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().list("test-rg", "wp39", Context.NONE); + } +} +``` + 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 c6339fbfe937..60a035e76ccd 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 @@ -26,11 +26,27 @@ import com.azure.resourcemanager.workloads.fluent.WorkloadsClient; import com.azure.resourcemanager.workloads.implementation.MonitorsImpl; import com.azure.resourcemanager.workloads.implementation.OperationsImpl; +import com.azure.resourcemanager.workloads.implementation.PhpWorkloadsImpl; import com.azure.resourcemanager.workloads.implementation.ProviderInstancesImpl; +import com.azure.resourcemanager.workloads.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.workloads.implementation.SapApplicationServerInstancesImpl; +import com.azure.resourcemanager.workloads.implementation.SapCentralInstancesImpl; +import com.azure.resourcemanager.workloads.implementation.SapDatabaseInstancesImpl; +import com.azure.resourcemanager.workloads.implementation.SapVirtualInstancesImpl; +import com.azure.resourcemanager.workloads.implementation.SkusImpl; +import com.azure.resourcemanager.workloads.implementation.WordpressInstancesImpl; import com.azure.resourcemanager.workloads.implementation.WorkloadsClientBuilder; import com.azure.resourcemanager.workloads.models.Monitors; import com.azure.resourcemanager.workloads.models.Operations; +import com.azure.resourcemanager.workloads.models.PhpWorkloads; import com.azure.resourcemanager.workloads.models.ProviderInstances; +import com.azure.resourcemanager.workloads.models.ResourceProviders; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstances; +import com.azure.resourcemanager.workloads.models.SapCentralInstances; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstances; +import com.azure.resourcemanager.workloads.models.SapVirtualInstances; +import com.azure.resourcemanager.workloads.models.Skus; +import com.azure.resourcemanager.workloads.models.WordpressInstances; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -40,12 +56,28 @@ /** Entry point to WorkloadsManager. Workloads client provides access to various workload operations. */ public final class WorkloadsManager { + private PhpWorkloads phpWorkloads; + + private WordpressInstances wordpressInstances; + + private ResourceProviders resourceProviders; + + private SapVirtualInstances sapVirtualInstances; + + private SapCentralInstances sapCentralInstances; + + private SapDatabaseInstances sapDatabaseInstances; + + private SapApplicationServerInstances sapApplicationServerInstances; + private Operations operations; private Monitors monitors; private ProviderInstances providerInstances; + private Skus skus; + private final WorkloadsClient clientObject; private WorkloadsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -268,6 +300,91 @@ public WorkloadsManager authenticate(TokenCredential credential, AzureProfile pr } } + /** + * Gets the resource collection API of PhpWorkloads. It manages PhpWorkloadResource. + * + * @return Resource collection API of PhpWorkloads. + */ + public PhpWorkloads phpWorkloads() { + if (this.phpWorkloads == null) { + this.phpWorkloads = new PhpWorkloadsImpl(clientObject.getPhpWorkloads(), this); + } + return phpWorkloads; + } + + /** + * Gets the resource collection API of WordpressInstances. + * + * @return Resource collection API of WordpressInstances. + */ + public WordpressInstances wordpressInstances() { + if (this.wordpressInstances == null) { + this.wordpressInstances = new WordpressInstancesImpl(clientObject.getWordpressInstances(), this); + } + return wordpressInstances; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance. + * + * @return Resource collection API of SapVirtualInstances. + */ + public SapVirtualInstances sapVirtualInstances() { + if (this.sapVirtualInstances == null) { + this.sapVirtualInstances = new SapVirtualInstancesImpl(clientObject.getSapVirtualInstances(), this); + } + return sapVirtualInstances; + } + + /** + * Gets the resource collection API of SapCentralInstances. It manages SapCentralServerInstance. + * + * @return Resource collection API of SapCentralInstances. + */ + public SapCentralInstances sapCentralInstances() { + if (this.sapCentralInstances == null) { + this.sapCentralInstances = new SapCentralInstancesImpl(clientObject.getSapCentralInstances(), this); + } + return sapCentralInstances; + } + + /** + * Gets the resource collection API of SapDatabaseInstances. It manages SapDatabaseInstance. + * + * @return Resource collection API of SapDatabaseInstances. + */ + public SapDatabaseInstances sapDatabaseInstances() { + if (this.sapDatabaseInstances == null) { + this.sapDatabaseInstances = new SapDatabaseInstancesImpl(clientObject.getSapDatabaseInstances(), this); + } + return 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); + } + return sapApplicationServerInstances; + } + /** * Gets the resource collection API of Operations. * @@ -304,6 +421,18 @@ public ProviderInstances providerInstances() { return providerInstances; } + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + /** * @return Wrapped service client WorkloadsClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. 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 6413c64f2145..94008ef427ef 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 @@ -100,7 +100,7 @@ Response getByResourceGroupWithResponse( * * @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. + * @param monitorParameter Request body representing a SAP monitor. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -116,7 +116,7 @@ SyncPoller, MonitorInner> beginCreate( * * @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. + * @param monitorParameter Request body representing a 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. @@ -133,7 +133,7 @@ SyncPoller, MonitorInner> beginCreate( * * @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. + * @param monitorParameter Request body representing a SAP monitor. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -147,7 +147,7 @@ SyncPoller, MonitorInner> beginCreate( * * @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. + * @param monitorParameter Request body representing a 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. @@ -158,7 +158,7 @@ SyncPoller, MonitorInner> beginCreate( MonitorInner create(String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -172,7 +172,7 @@ SyncPoller, OperationStatusResultInner> b String resourceGroupName, String monitorName); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -187,7 +187,7 @@ SyncPoller, OperationStatusResultInner> b String resourceGroupName, String monitorName, Context context); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -200,7 +200,7 @@ SyncPoller, OperationStatusResultInner> b OperationStatusResultInner delete(String resourceGroupName, String monitorName); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -214,7 +214,7 @@ SyncPoller, OperationStatusResultInner> b OperationStatusResultInner delete(String resourceGroupName, String monitorName, Context context); /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. @@ -228,7 +228,7 @@ SyncPoller, OperationStatusResultInner> b MonitorInner update(String resourceGroupName, String monitorName, Tags tagsParameter); /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/PhpWorkloadsClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/PhpWorkloadsClient.java new file mode 100644 index 000000000000..eb4623d12ffc --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/PhpWorkloadsClient.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBody; + +/** An instance of this class provides access to all the operations defined in PhpWorkloadsClient. */ +public interface PhpWorkloadsClient { + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhpWorkloadResourceInner getByResourceGroup(String resourceGroupName, String phpWorkloadName); + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhpWorkloadResourceInner> beginCreateOrUpdate( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource); + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhpWorkloadResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context); + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhpWorkloadResourceInner createOrUpdate( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource); + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhpWorkloadResourceInner createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context); + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhpWorkloadResourceInner update( + String resourceGroupName, String phpWorkloadName, PatchResourceRequestBody resourcePatchRequestBody); + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String phpWorkloadName, + PatchResourceRequestBody resourcePatchRequestBody, + Context context); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String phpWorkloadName, String deleteInfra); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String phpWorkloadName); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra, 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 eab1895c11b5..466ede81bac1 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 @@ -48,8 +48,8 @@ public interface ProviderInstancesClient { PagedIterable list(String resourceGroupName, String monitorName, Context context); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -57,15 +57,15 @@ public interface ProviderInstancesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) ProviderInstanceInner get(String resourceGroupName, String monitorName, String providerInstanceName); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -74,7 +74,7 @@ public interface ProviderInstancesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -82,7 +82,7 @@ Response getWithResponse( String resourceGroupName, String monitorName, String providerInstanceName, Context context); /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -91,7 +91,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProviderInstanceInner> beginCreate( @@ -101,7 +101,7 @@ SyncPoller, ProviderInstanceInner> beginCreate ProviderInstanceInner providerInstanceParameter); /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -111,7 +111,7 @@ SyncPoller, ProviderInstanceInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProviderInstanceInner> beginCreate( @@ -122,7 +122,7 @@ SyncPoller, ProviderInstanceInner> beginCreate Context context); /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -131,7 +131,7 @@ SyncPoller, ProviderInstanceInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 monitor. + * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) ProviderInstanceInner create( @@ -141,7 +141,7 @@ ProviderInstanceInner create( ProviderInstanceInner providerInstanceParameter); /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -151,7 +151,7 @@ ProviderInstanceInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 monitor. + * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) ProviderInstanceInner create( @@ -162,7 +162,7 @@ ProviderInstanceInner create( Context context); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -177,7 +177,7 @@ SyncPoller, OperationStatusResultInner> b String resourceGroupName, String monitorName, String providerInstanceName); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -193,7 +193,7 @@ SyncPoller, OperationStatusResultInner> b String resourceGroupName, String monitorName, String providerInstanceName, Context context); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -207,7 +207,7 @@ SyncPoller, OperationStatusResultInner> b OperationStatusResultInner delete(String resourceGroupName, String monitorName, String providerInstanceName); /** - * Deletes a provider instance for the specified subscription, resource group, 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. 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 new file mode 100644 index 000000000000..b7079ea3b8ff --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/ResourceProvidersClient.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; +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. */ +public interface ResourceProvidersClient { + /** + * Get SAP sizing recommendations. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapSizingRecommendationResultInner sapSizingRecommendations(String location); + + /** + * Get SAP sizing recommendations. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + + /** + * Get SAP supported SKUs. + * + * @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 supported SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapSupportedResourceSkusResultInner sapSupportedSku(String location); + + /** + * Get SAP supported SKUs. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 supported SKUs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context); + + /** + * Get SAP Disk Configurations. + * + * @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 Disk Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDiskConfigurationsResultInner sapDiskConfigurations(String location); + + /** + * Get SAP Disk Configurations. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk Configurations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + + /** + * Get SAP Availability Zone Details. + * + * @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 Availability Zone Details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapAvailabilityZoneDetailsResultInner sapAvailabilityZoneDetails(String location); + + /** + * Get SAP Availability Zone Details. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Availability Zone Details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); +} 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 new file mode 100644 index 000000000000..f8509bfd6b4b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapApplicationServerInstancesClient.java @@ -0,0 +1,341 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloads.models.UpdateSapApplicationInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +public interface SapApplicationServerInstancesClient { + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Gets 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. + * @param applicationInstanceName The name of 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body); + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context); + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body); + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context); + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body); + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context); + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body); + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of 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. + * @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 applicationInstanceName, Context context); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of 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. + * @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 applicationInstanceName, Context context); + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, 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 new file mode 100644 index 000000000000..e1de49990520 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapCentralInstancesClient.java @@ -0,0 +1,355 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloads.models.UpdateSapCentralInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +public interface SapCentralInstancesClient { + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body); + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context); + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body); + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context); + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body); + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context); + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body); + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 {@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); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner delete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, 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 new file mode 100644 index 000000000000..f82aa8fc463e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapDatabaseInstancesClient.java @@ -0,0 +1,338 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloads.models.UpdateSapDatabaseInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +public interface SapDatabaseInstancesClient { + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body); + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context); + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body); + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context); + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body); + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context); + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body); + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 {@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); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner delete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); +} 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 new file mode 100644 index 000000000000..f0c5f98d6f3e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SapVirtualInstancesClient.java @@ -0,0 +1,385 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +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. */ +public interface SapVirtualInstancesClient { + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body); + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body); + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner update(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Update Virtual Instance for SAP request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body, Context context); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, Context context); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, Context context); + + /** + * Gets all Virtual Instances for SAP 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 in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all Virtual Instances for SAP 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 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 in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStart( + String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStart( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginStop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body); + + /** + * Stops 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 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/SkusClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SkusClient.java new file mode 100644 index 000000000000..5b1f46048756 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/SkusClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available SKUs 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 SKUs 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/WordpressInstancesClient.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WordpressInstancesClient.java new file mode 100644 index 000000000000..88f5c177b998 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/WordpressInstancesClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; + +/** An instance of this class provides access to all the operations defined in WordpressInstancesClient. */ +public interface WordpressInstancesClient { + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String phpWorkloadName); + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WordpressInstanceResourceInner get(String resourceGroupName, String phpWorkloadName); + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WordpressInstanceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WordpressInstanceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WordpressInstanceResourceInner createOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WordpressInstanceResourceInner createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context); + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String phpWorkloadName); + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String phpWorkloadName, 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 11d9428973b5..fc54bccec567 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 @@ -44,6 +44,55 @@ public interface WorkloadsClient { */ Duration getDefaultPollInterval(); + /** + * Gets the PhpWorkloadsClient object to access its operations. + * + * @return the PhpWorkloadsClient object. + */ + PhpWorkloadsClient getPhpWorkloads(); + + /** + * Gets the WordpressInstancesClient object to access its operations. + * + * @return the WordpressInstancesClient object. + */ + WordpressInstancesClient getWordpressInstances(); + + /** + * 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 OperationsClient object to access its operations. * @@ -64,4 +113,11 @@ public interface WorkloadsClient { * @return the ProviderInstancesClient object. */ ProviderInstancesClient getProviderInstances(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); } 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 e9738c07fd22..6a118a92ef15 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; import com.azure.resourcemanager.workloads.models.MonitorPropertiesErrors; import com.azure.resourcemanager.workloads.models.RoutingPreference; @@ -22,6 +23,13 @@ public final class MonitorInner extends Resource { @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; + /** * Get the innerProperties property: SAP monitor properties. * @@ -31,6 +39,15 @@ private MonitorProperties innerProperties() { return this.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} */ @Override public MonitorInner withLocation(String location) { @@ -46,7 +63,7 @@ public MonitorInner withTags(Map tags) { } /** - * Get the provisioningState property: State of provisioning of the monitor. + * Get the provisioningState property: State of provisioning of the SAP monitor. * * @return the provisioningState value. */ @@ -64,8 +81,8 @@ public MonitorPropertiesErrors errors() { } /** - * Get the appLocation property: The monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the monitoring region. + * 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. */ @@ -74,8 +91,8 @@ public String appLocation() { } /** - * Set the appLocation property: The monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the monitoring region. + * 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. @@ -89,8 +106,8 @@ public MonitorInner withAppLocation(String appLocation) { } /** - * Get the routingPreference property: Sets the routing preference of the monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * 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. */ @@ -99,8 +116,8 @@ public RoutingPreference routingPreference() { } /** - * Set the routingPreference property: Sets the routing preference of the monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * 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. @@ -138,7 +155,7 @@ public MonitorInner withManagedResourceGroupConfiguration( } /** - * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. * * @return the logAnalyticsWorkspaceArmId value. @@ -148,7 +165,7 @@ public String logAnalyticsWorkspaceArmId() { } /** - * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * 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. @@ -186,7 +203,7 @@ public MonitorInner withMonitorSubnet(String monitorSubnet) { } /** - * Get the msiArmId property: The ARM ID of the MSI used for monitoring. + * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. * * @return the msiArmId value. */ 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 a1b231c852b1..8fd2268a33b7 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 @@ -15,7 +15,7 @@ @Fluent public final class MonitorProperties { /* - * State of provisioning of the monitor. + * State of provisioning of the SAP monitor. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private WorkloadMonitorProvisioningState provisioningState; @@ -27,14 +27,14 @@ public final class MonitorProperties { private MonitorPropertiesErrors errors; /* - * The monitor resources will be deployed in the monitoring region. The - * subnet region should be same as the monitoring region. + * 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 monitor. By default only RFC1918 + * Sets the routing preference of the SAP monitor. By default only RFC1918 * traffic is routed to the customer VNET. */ @JsonProperty(value = "routingPreference") @@ -47,7 +47,8 @@ public final class MonitorProperties { private ManagedRGConfiguration managedResourceGroupConfiguration; /* - * The ARM ID of the Log Analytics Workspace that is used for monitoring. + * The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. */ @JsonProperty(value = "logAnalyticsWorkspaceArmId") private String logAnalyticsWorkspaceArmId; @@ -59,13 +60,13 @@ public final class MonitorProperties { private String monitorSubnet; /* - * The ARM ID of the MSI used for monitoring. + * The ARM ID of the MSI used for SAP monitoring. */ @JsonProperty(value = "msiArmId", access = JsonProperty.Access.WRITE_ONLY) private String msiArmId; /** - * Get the provisioningState property: State of provisioning of the monitor. + * Get the provisioningState property: State of provisioning of the SAP monitor. * * @return the provisioningState value. */ @@ -83,8 +84,8 @@ public MonitorPropertiesErrors errors() { } /** - * Get the appLocation property: The monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the monitoring region. + * 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. */ @@ -93,8 +94,8 @@ public String appLocation() { } /** - * Set the appLocation property: The monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the monitoring region. + * 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. @@ -105,8 +106,8 @@ public MonitorProperties withAppLocation(String appLocation) { } /** - * Get the routingPreference property: Sets the routing preference of the monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * 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. */ @@ -115,8 +116,8 @@ public RoutingPreference routingPreference() { } /** - * Set the routingPreference property: Sets the routing preference of the monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * 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. @@ -148,7 +149,7 @@ public MonitorProperties withManagedResourceGroupConfiguration( } /** - * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. * * @return the logAnalyticsWorkspaceArmId value. @@ -158,7 +159,7 @@ public String logAnalyticsWorkspaceArmId() { } /** - * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * 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. @@ -190,7 +191,7 @@ public MonitorProperties withMonitorSubnet(String monitorSubnet) { } /** - * Get the msiArmId property: The ARM ID of the MSI used for monitoring. + * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. * * @return the msiArmId value. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceInner.java new file mode 100644 index 000000000000..5b2fa23649c5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceInner.java @@ -0,0 +1,472 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.BackupProfile; +import com.azure.resourcemanager.workloads.models.CacheProfile; +import com.azure.resourcemanager.workloads.models.DatabaseProfile; +import com.azure.resourcemanager.workloads.models.FileshareProfile; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkProfile; +import com.azure.resourcemanager.workloads.models.NodeProfile; +import com.azure.resourcemanager.workloads.models.PhpProfile; +import com.azure.resourcemanager.workloads.models.PhpWorkloadProvisioningState; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResourceIdentity; +import com.azure.resourcemanager.workloads.models.SearchProfile; +import com.azure.resourcemanager.workloads.models.SiteProfile; +import com.azure.resourcemanager.workloads.models.Sku; +import com.azure.resourcemanager.workloads.models.UserProfile; +import com.azure.resourcemanager.workloads.models.VmssNodesProfile; +import com.azure.resourcemanager.workloads.models.WorkloadKind; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Php workload resource. */ +@Fluent +public final class PhpWorkloadResourceInner extends Resource { + /* + * Resource properties + */ + @JsonProperty(value = "properties") + private PhpWorkloadResourceProperties innerProperties; + + /* + * Indicates which kind of php workload this resource represent e.g + * WordPress + */ + @JsonProperty(value = "kind", required = true) + private WorkloadKind kind; + + /* + * Php workloads SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Identity for the resource. Currently not supported + */ + @JsonProperty(value = "identity") + private PhpWorkloadResourceIdentity identity; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PhpWorkloadResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the kind property: Indicates which kind of php workload this resource represent e.g WordPress. + * + * @return the kind value. + */ + public WorkloadKind kind() { + return this.kind; + } + + /** + * Set the kind property: Indicates which kind of php workload this resource represent e.g WordPress. + * + * @param kind the kind value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withKind(WorkloadKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the sku property: Php workloads SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Php workloads SKU. + * + * @param sku the sku value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Identity for the resource. Currently not supported. + * + * @return the identity value. + */ + public PhpWorkloadResourceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. Currently not supported. + * + * @param identity the identity value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withIdentity(PhpWorkloadResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public PhpWorkloadResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PhpWorkloadResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the appLocation property: The infra resources for PHP workload will be created in this location. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.innerProperties() == null ? null : this.innerProperties().appLocation(); + } + + /** + * Set the appLocation property: The infra resources for PHP workload will be created in this location. + * + * @param appLocation the appLocation value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withAppLocation(String appLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withAppLocation(appLocation); + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration of the workload. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration of the workload. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @return the adminUserProfile value. + */ + public UserProfile adminUserProfile() { + return this.innerProperties() == null ? null : this.innerProperties().adminUserProfile(); + } + + /** + * Set the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @param adminUserProfile the adminUserProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withAdminUserProfile(UserProfile adminUserProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withAdminUserProfile(adminUserProfile); + return this; + } + + /** + * Get the webNodesProfile property: VMSS web nodes profile. + * + * @return the webNodesProfile value. + */ + public VmssNodesProfile webNodesProfile() { + return this.innerProperties() == null ? null : this.innerProperties().webNodesProfile(); + } + + /** + * Set the webNodesProfile property: VMSS web nodes profile. + * + * @param webNodesProfile the webNodesProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withWebNodesProfile(VmssNodesProfile webNodesProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withWebNodesProfile(webNodesProfile); + return this; + } + + /** + * Get the controllerProfile property: Controller VM profile. + * + * @return the controllerProfile value. + */ + public NodeProfile controllerProfile() { + return this.innerProperties() == null ? null : this.innerProperties().controllerProfile(); + } + + /** + * Set the controllerProfile property: Controller VM profile. + * + * @param controllerProfile the controllerProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withControllerProfile(NodeProfile controllerProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withControllerProfile(controllerProfile); + return this; + } + + /** + * Get the networkProfile property: Network profile. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Network profile. + * + * @param networkProfile the networkProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withNetworkProfile(NetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the databaseProfile property: Database profile. + * + * @return the databaseProfile value. + */ + public DatabaseProfile databaseProfile() { + return this.innerProperties() == null ? null : this.innerProperties().databaseProfile(); + } + + /** + * Set the databaseProfile property: Database profile. + * + * @param databaseProfile the databaseProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withDatabaseProfile(DatabaseProfile databaseProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withDatabaseProfile(databaseProfile); + return this; + } + + /** + * Get the siteProfile property: Site profile. + * + * @return the siteProfile value. + */ + public SiteProfile siteProfile() { + return this.innerProperties() == null ? null : this.innerProperties().siteProfile(); + } + + /** + * Set the siteProfile property: Site profile. + * + * @param siteProfile the siteProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withSiteProfile(SiteProfile siteProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withSiteProfile(siteProfile); + return this; + } + + /** + * Get the fileshareProfile property: File share profile. + * + * @return the fileshareProfile value. + */ + public FileshareProfile fileshareProfile() { + return this.innerProperties() == null ? null : this.innerProperties().fileshareProfile(); + } + + /** + * Set the fileshareProfile property: File share profile. + * + * @param fileshareProfile the fileshareProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withFileshareProfile(FileshareProfile fileshareProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withFileshareProfile(fileshareProfile); + return this; + } + + /** + * Get the phpProfile property: PHP profile. + * + * @return the phpProfile value. + */ + public PhpProfile phpProfile() { + return this.innerProperties() == null ? null : this.innerProperties().phpProfile(); + } + + /** + * Set the phpProfile property: PHP profile. + * + * @param phpProfile the phpProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withPhpProfile(PhpProfile phpProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withPhpProfile(phpProfile); + return this; + } + + /** + * Get the searchProfile property: Search profile. + * + * @return the searchProfile value. + */ + public SearchProfile searchProfile() { + return this.innerProperties() == null ? null : this.innerProperties().searchProfile(); + } + + /** + * Set the searchProfile property: Search profile. + * + * @param searchProfile the searchProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withSearchProfile(SearchProfile searchProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withSearchProfile(searchProfile); + return this; + } + + /** + * Get the cacheProfile property: Cache profile. + * + * @return the cacheProfile value. + */ + public CacheProfile cacheProfile() { + return this.innerProperties() == null ? null : this.innerProperties().cacheProfile(); + } + + /** + * Set the cacheProfile property: Cache profile. + * + * @param cacheProfile the cacheProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withCacheProfile(CacheProfile cacheProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withCacheProfile(cacheProfile); + return this; + } + + /** + * Get the backupProfile property: Backup profile. + * + * @return the backupProfile value. + */ + public BackupProfile backupProfile() { + return this.innerProperties() == null ? null : this.innerProperties().backupProfile(); + } + + /** + * Set the backupProfile property: Backup profile. + * + * @param backupProfile the backupProfile value to set. + * @return the PhpWorkloadResourceInner object itself. + */ + public PhpWorkloadResourceInner withBackupProfile(BackupProfile backupProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new PhpWorkloadResourceProperties(); + } + this.innerProperties().withBackupProfile(backupProfile); + return this; + } + + /** + * Get the provisioningState property: Php workload resource provisioning state. + * + * @return the provisioningState value. + */ + public PhpWorkloadProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (kind() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model PhpWorkloadResourceInner")); + } + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhpWorkloadResourceInner.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceProperties.java new file mode 100644 index 000000000000..eeaf3a603155 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/PhpWorkloadResourceProperties.java @@ -0,0 +1,452 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.BackupProfile; +import com.azure.resourcemanager.workloads.models.CacheProfile; +import com.azure.resourcemanager.workloads.models.DatabaseProfile; +import com.azure.resourcemanager.workloads.models.FileshareProfile; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkProfile; +import com.azure.resourcemanager.workloads.models.NodeProfile; +import com.azure.resourcemanager.workloads.models.PhpProfile; +import com.azure.resourcemanager.workloads.models.PhpWorkloadProvisioningState; +import com.azure.resourcemanager.workloads.models.SearchProfile; +import com.azure.resourcemanager.workloads.models.SiteProfile; +import com.azure.resourcemanager.workloads.models.UserProfile; +import com.azure.resourcemanager.workloads.models.VmssNodesProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PHP workload resource properties. */ +@Fluent +public final class PhpWorkloadResourceProperties { + /* + * The infra resources for PHP workload will be created in this location + */ + @JsonProperty(value = "appLocation", required = true) + private String appLocation; + + /* + * Managed resource group configuration of the workload + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedRGConfiguration managedResourceGroupConfiguration; + + /* + * Admin user profile used for VM and VMSS + */ + @JsonProperty(value = "adminUserProfile", required = true) + private UserProfile adminUserProfile; + + /* + * VMSS web nodes profile + */ + @JsonProperty(value = "webNodesProfile", required = true) + private VmssNodesProfile webNodesProfile; + + /* + * Controller VM profile + */ + @JsonProperty(value = "controllerProfile", required = true) + private NodeProfile controllerProfile; + + /* + * Network profile + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Database profile + */ + @JsonProperty(value = "databaseProfile", required = true) + private DatabaseProfile databaseProfile; + + /* + * Site profile + */ + @JsonProperty(value = "siteProfile") + private SiteProfile siteProfile; + + /* + * File share profile + */ + @JsonProperty(value = "fileshareProfile") + private FileshareProfile fileshareProfile; + + /* + * PHP profile + */ + @JsonProperty(value = "phpProfile") + private PhpProfile phpProfile; + + /* + * Search profile + */ + @JsonProperty(value = "searchProfile") + private SearchProfile searchProfile; + + /* + * Cache profile + */ + @JsonProperty(value = "cacheProfile") + private CacheProfile cacheProfile; + + /* + * Backup profile + */ + @JsonProperty(value = "backupProfile") + private BackupProfile backupProfile; + + /* + * Php workload resource provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PhpWorkloadProvisioningState provisioningState; + + /** + * Get the appLocation property: The infra resources for PHP workload will be created in this location. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The infra resources for PHP workload will be created in this location. + * + * @param appLocation the appLocation value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration of the workload. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration of the workload. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @return the adminUserProfile value. + */ + public UserProfile adminUserProfile() { + return this.adminUserProfile; + } + + /** + * Set the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @param adminUserProfile the adminUserProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withAdminUserProfile(UserProfile adminUserProfile) { + this.adminUserProfile = adminUserProfile; + return this; + } + + /** + * Get the webNodesProfile property: VMSS web nodes profile. + * + * @return the webNodesProfile value. + */ + public VmssNodesProfile webNodesProfile() { + return this.webNodesProfile; + } + + /** + * Set the webNodesProfile property: VMSS web nodes profile. + * + * @param webNodesProfile the webNodesProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withWebNodesProfile(VmssNodesProfile webNodesProfile) { + this.webNodesProfile = webNodesProfile; + return this; + } + + /** + * Get the controllerProfile property: Controller VM profile. + * + * @return the controllerProfile value. + */ + public NodeProfile controllerProfile() { + return this.controllerProfile; + } + + /** + * Set the controllerProfile property: Controller VM profile. + * + * @param controllerProfile the controllerProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withControllerProfile(NodeProfile controllerProfile) { + this.controllerProfile = controllerProfile; + return this; + } + + /** + * Get the networkProfile property: Network profile. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network profile. + * + * @param networkProfile the networkProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the databaseProfile property: Database profile. + * + * @return the databaseProfile value. + */ + public DatabaseProfile databaseProfile() { + return this.databaseProfile; + } + + /** + * Set the databaseProfile property: Database profile. + * + * @param databaseProfile the databaseProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withDatabaseProfile(DatabaseProfile databaseProfile) { + this.databaseProfile = databaseProfile; + return this; + } + + /** + * Get the siteProfile property: Site profile. + * + * @return the siteProfile value. + */ + public SiteProfile siteProfile() { + return this.siteProfile; + } + + /** + * Set the siteProfile property: Site profile. + * + * @param siteProfile the siteProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withSiteProfile(SiteProfile siteProfile) { + this.siteProfile = siteProfile; + return this; + } + + /** + * Get the fileshareProfile property: File share profile. + * + * @return the fileshareProfile value. + */ + public FileshareProfile fileshareProfile() { + return this.fileshareProfile; + } + + /** + * Set the fileshareProfile property: File share profile. + * + * @param fileshareProfile the fileshareProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withFileshareProfile(FileshareProfile fileshareProfile) { + this.fileshareProfile = fileshareProfile; + return this; + } + + /** + * Get the phpProfile property: PHP profile. + * + * @return the phpProfile value. + */ + public PhpProfile phpProfile() { + return this.phpProfile; + } + + /** + * Set the phpProfile property: PHP profile. + * + * @param phpProfile the phpProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withPhpProfile(PhpProfile phpProfile) { + this.phpProfile = phpProfile; + return this; + } + + /** + * Get the searchProfile property: Search profile. + * + * @return the searchProfile value. + */ + public SearchProfile searchProfile() { + return this.searchProfile; + } + + /** + * Set the searchProfile property: Search profile. + * + * @param searchProfile the searchProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withSearchProfile(SearchProfile searchProfile) { + this.searchProfile = searchProfile; + return this; + } + + /** + * Get the cacheProfile property: Cache profile. + * + * @return the cacheProfile value. + */ + public CacheProfile cacheProfile() { + return this.cacheProfile; + } + + /** + * Set the cacheProfile property: Cache profile. + * + * @param cacheProfile the cacheProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withCacheProfile(CacheProfile cacheProfile) { + this.cacheProfile = cacheProfile; + return this; + } + + /** + * Get the backupProfile property: Backup profile. + * + * @return the backupProfile value. + */ + public BackupProfile backupProfile() { + return this.backupProfile; + } + + /** + * Set the backupProfile property: Backup profile. + * + * @param backupProfile the backupProfile value to set. + * @return the PhpWorkloadResourceProperties object itself. + */ + public PhpWorkloadResourceProperties withBackupProfile(BackupProfile backupProfile) { + this.backupProfile = backupProfile; + return this; + } + + /** + * Get the provisioningState property: Php workload resource provisioning state. + * + * @return the provisioningState value. + */ + public PhpWorkloadProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * 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 PhpWorkloadResourceProperties")); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (adminUserProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUserProfile in model PhpWorkloadResourceProperties")); + } else { + adminUserProfile().validate(); + } + if (webNodesProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property webNodesProfile in model PhpWorkloadResourceProperties")); + } else { + webNodesProfile().validate(); + } + if (controllerProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property controllerProfile in model PhpWorkloadResourceProperties")); + } else { + controllerProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (databaseProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseProfile in model PhpWorkloadResourceProperties")); + } else { + databaseProfile().validate(); + } + if (siteProfile() != null) { + siteProfile().validate(); + } + if (fileshareProfile() != null) { + fileshareProfile().validate(); + } + if (phpProfile() != null) { + phpProfile().validate(); + } + if (searchProfile() != null) { + searchProfile().validate(); + } + if (cacheProfile() != null) { + cacheProfile().validate(); + } + if (backupProfile() != null) { + backupProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhpWorkloadResourceProperties.class); +} 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 1f94cf60502e..ba3cafb0fd59 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 @@ -6,12 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; 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; -/** A provider instance associated with monitor. */ +/** A provider instance associated with SAP monitor. */ @Fluent public final class ProviderInstanceInner extends ProxyResource { /* @@ -20,6 +21,13 @@ public final class ProviderInstanceInner extends ProxyResource { @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; + /** * Get the innerProperties property: Provider Instance properties. * @@ -29,6 +37,15 @@ private ProviderInstanceProperties innerProperties() { return this.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 provisioningState property: State of provisioning of the provider instance. * 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 new file mode 100644 index 000000000000..f71b53ccb489 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerInstanceInner.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +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.util.Map; + +/** Define the SAP Application Server Instance. */ +@Fluent +public final class SapApplicationServerInstanceInner extends Resource { + /* + * Defines the SAP Application Server 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; + + /** + * Get the innerProperties property: Defines the SAP Application Server properties. + * + * @return the innerProperties value. + */ + private SapApplicationServerProperties innerProperties() { + return this.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} */ + @Override + public SapApplicationServerInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapApplicationServerInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the instanceNo property: The application server instance id. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.innerProperties() == null ? null : this.innerProperties().instanceNo(); + } + + /** + * Get the subnet property: The application server subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the hostname property: The application server SAP host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the kernelVersion property: The application server SAP kernel version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kernelVersion(); + } + + /** + * Get the kernelPatch property: The application server SAP kernel patch. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.innerProperties() == null ? null : this.innerProperties().kernelPatch(); + } + + /** + * Get the ipAddress property: The application server SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Get the gatewayPort property: The application server gateway Port. + * + * @return the gatewayPort value. + */ + public Long gatewayPort() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayPort(); + } + + /** + * Get the icmHttpPort property: The application server ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + public Long icmHttpPort() { + return this.innerProperties() == null ? null : this.innerProperties().icmHttpPort(); + } + + /** + * Get the icmHttpsPort property: The application server ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + public Long icmHttpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().icmHttpsPort(); + } + + /** + * Get the virtualMachineId property: The virtual machine. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineId(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the Application Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 new file mode 100644 index 000000000000..43bfc4739e58 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapApplicationServerProperties.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Immutable; +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; + +/** Defines the SAP Application Server properties. */ +@Immutable +public final class SapApplicationServerProperties { + /* + * The application server instance id. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * The application server subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * The application server SAP host name. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The application server SAP kernel version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * The application server SAP kernel patch. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * The application server SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The application server gateway Port. + */ + @JsonProperty(value = "gatewayPort", access = JsonProperty.Access.WRITE_ONLY) + private Long gatewayPort; + + /* + * The application server ICM HTTP Port. + */ + @JsonProperty(value = "icmHttpPort", access = JsonProperty.Access.WRITE_ONLY) + private Long icmHttpPort; + + /* + * The application server ICM HTTPS Port. + */ + @JsonProperty(value = "icmHttpsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long icmHttpsPort; + + /* + * The virtual machine. + */ + @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; + + /* + * Defines the SAP Instance health. + */ + @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; + + /** + * Get the instanceNo property: The application server instance id. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the subnet property: The application server subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the hostname property: The application server SAP host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the kernelVersion property: The application server SAP kernel version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: The application server SAP kernel patch. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the ipAddress property: The application server SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the gatewayPort property: The application server gateway Port. + * + * @return the gatewayPort value. + */ + public Long gatewayPort() { + return this.gatewayPort; + } + + /** + * Get the icmHttpPort property: The application server ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + public Long icmHttpPort() { + return this.icmHttpPort; + } + + /** + * Get the icmHttpsPort property: The application server ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + public Long icmHttpsPort() { + return this.icmHttpsPort; + } + + /** + * Get the virtualMachineId property: The virtual machine. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the Application Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().validate(); + } + } +} 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 new file mode 100644 index 000000000000..1fb1de1c4bce --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapAvailabilityZoneDetailsResultInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZonePair; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of supported availability zone pairs which are part of SAP HA deployment. */ +@Fluent +public final class SapAvailabilityZoneDetailsResultInner { + /* + * Gets the list of availability zone pairs. + */ + @JsonProperty(value = "availabilityZonePairs") + private List availabilityZonePairs; + + /** + * Get the availabilityZonePairs property: Gets the list of availability zone pairs. + * + * @return the availabilityZonePairs value. + */ + public List availabilityZonePairs() { + return this.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) { + this.availabilityZonePairs = availabilityZonePairs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilityZonePairs() != null) { + availabilityZonePairs().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..e29c48d3ca4a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerInstanceInner.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; +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.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.util.List; +import java.util.Map; + +/** Define the SAP Central Server Instance. */ +@Fluent +public final class SapCentralServerInstanceInner extends Resource { + /* + * Defines the SAP Central Server 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; + + /** + * Get the innerProperties property: Defines the SAP Central Server properties. + * + * @return the innerProperties value. + */ + private SapCentralServerProperties innerProperties() { + return this.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} */ + @Override + public SapCentralServerInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapCentralServerInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the instanceNo property: The central server instance id. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.innerProperties() == null ? null : this.innerProperties().instanceNo(); + } + + /** + * Get the subnet property: The central server subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the messageServerProperties property: Defines the SAP message server properties. + * + * @return the messageServerProperties value. + */ + public MessageServerProperties messageServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().messageServerProperties(); + } + + /** + * Set the messageServerProperties property: Defines the SAP message server properties. + * + * @param messageServerProperties the messageServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withMessageServerProperties(MessageServerProperties messageServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withMessageServerProperties(messageServerProperties); + return this; + } + + /** + * Get the enqueueServerProperties property: Defines the SAP enqueue server properties. + * + * @return the enqueueServerProperties value. + */ + public EnqueueServerProperties enqueueServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().enqueueServerProperties(); + } + + /** + * Set the enqueueServerProperties property: Defines the SAP enqueue server properties. + * + * @param enqueueServerProperties the enqueueServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withEnqueueServerProperties(enqueueServerProperties); + return this; + } + + /** + * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @return the gatewayServerProperties value. + */ + public GatewayServerProperties gatewayServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayServerProperties(); + } + + /** + * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @param gatewayServerProperties the gatewayServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withGatewayServerProperties(gatewayServerProperties); + return this; + } + + /** + * Get the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties. + * + * @return the enqueueReplicationServerProperties value. + */ + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().enqueueReplicationServerProperties(); + } + + /** + * Set the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties. + * + * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withEnqueueReplicationServerProperties(enqueueReplicationServerProperties); + return this; + } + + /** + * Get the kernelVersion property: The central server kernel version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kernelVersion(); + } + + /** + * Get the kernelPatch property: The central server kernel patch. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.innerProperties() == null ? null : this.innerProperties().kernelPatch(); + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.innerProperties() == null ? null : this.innerProperties().vmDetails(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the Central Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 new file mode 100644 index 000000000000..d8fdca9d94c0 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapCentralServerProperties.java @@ -0,0 +1,288 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; +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.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.util.List; + +/** Defines the SAP Central Server properties. */ +@Fluent +public final class SapCentralServerProperties { + /* + * The central server instance id. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * The central server 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 ERS Server properties. + */ + @JsonProperty(value = "enqueueReplicationServerProperties") + private EnqueueReplicationServerProperties enqueueReplicationServerProperties; + + /* + * The central server kernel version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * The central server kernel patch. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * 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 SAP Instance health. + */ + @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 Central Instance errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** + * Get the instanceNo property: The central server instance id. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the subnet property: The central server subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the messageServerProperties property: Defines the SAP message server properties. + * + * @return the messageServerProperties value. + */ + public MessageServerProperties messageServerProperties() { + return this.messageServerProperties; + } + + /** + * Set the messageServerProperties property: Defines the SAP message server properties. + * + * @param messageServerProperties the messageServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withMessageServerProperties(MessageServerProperties messageServerProperties) { + this.messageServerProperties = messageServerProperties; + return this; + } + + /** + * Get the enqueueServerProperties property: Defines the SAP enqueue server properties. + * + * @return the enqueueServerProperties value. + */ + public EnqueueServerProperties enqueueServerProperties() { + return this.enqueueServerProperties; + } + + /** + * Set the enqueueServerProperties property: Defines the SAP enqueue server properties. + * + * @param enqueueServerProperties the enqueueServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + this.enqueueServerProperties = enqueueServerProperties; + return this; + } + + /** + * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @return the gatewayServerProperties value. + */ + public GatewayServerProperties gatewayServerProperties() { + return this.gatewayServerProperties; + } + + /** + * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @param gatewayServerProperties the gatewayServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + this.gatewayServerProperties = gatewayServerProperties; + return this; + } + + /** + * Get the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties. + * + * @return the enqueueReplicationServerProperties value. + */ + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.enqueueReplicationServerProperties; + } + + /** + * Set the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties. + * + * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + this.enqueueReplicationServerProperties = enqueueReplicationServerProperties; + return this; + } + + /** + * Get the kernelVersion property: The central server kernel version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: The central server kernel patch. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the Central Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (messageServerProperties() != null) { + messageServerProperties().validate(); + } + if (enqueueServerProperties() != null) { + enqueueServerProperties().validate(); + } + if (gatewayServerProperties() != null) { + gatewayServerProperties().validate(); + } + if (enqueueReplicationServerProperties() != null) { + enqueueReplicationServerProperties().validate(); + } + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} 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 new file mode 100644 index 000000000000..ec6ff25a8927 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseInstanceInner.java @@ -0,0 +1,148 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; +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.util.List; +import java.util.Map; + +/** Define the SAP Database Instance. */ +@Fluent +public final class SapDatabaseInstanceInner extends Resource { + /* + * Defines the SAP 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; + + /** + * Get the innerProperties property: Defines the SAP Database properties. + * + * @return the innerProperties value. + */ + private SapDatabaseProperties innerProperties() { + return this.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} */ + @Override + public SapDatabaseInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapDatabaseInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the subnet property: The database subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the databaseSid property: The database SID. + * + * @return the databaseSid value. + */ + public String databaseSid() { + return this.innerProperties() == null ? null : this.innerProperties().databaseSid(); + } + + /** + * Get the databaseType property: The SAP database type. + * + * @return the databaseType value. + */ + public String databaseType() { + return this.innerProperties() == null ? null : this.innerProperties().databaseType(); + } + + /** + * Get the ipAddress property: The database IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.innerProperties() == null ? null : this.innerProperties().vmDetails(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the Database Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 new file mode 100644 index 000000000000..c65863771839 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDatabaseProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; +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.util.List; + +/** Defines the SAP Database properties. */ +@Immutable +public final class SapDatabaseProperties { + /* + * The database subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * The database SID. + */ + @JsonProperty(value = "databaseSid", access = JsonProperty.Access.WRITE_ONLY) + private String databaseSid; + + /* + * The SAP database type. + */ + @JsonProperty(value = "databaseType", access = JsonProperty.Access.WRITE_ONLY) + private String databaseType; + + /* + * The database IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * 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 provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceProvisioningState provisioningState; + + /* + * Defines the Database Instance errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** + * Get the subnet property: The database subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the databaseSid property: The database SID. + * + * @return the databaseSid value. + */ + public String databaseSid() { + return this.databaseSid; + } + + /** + * Get the databaseType property: The SAP database type. + * + * @return the databaseType value. + */ + public String databaseType() { + return this.databaseType; + } + + /** + * Get the ipAddress property: The database IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the Database Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} 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 new file mode 100644 index 000000000000..f736eb9f7f78 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapDiskConfigurationsResultInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.models.SapDiskConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of disk configuration for vmSku which are part of SAP deployment. */ +@Fluent +public final class SapDiskConfigurationsResultInner { + /* + * Gets the list of Disk Configurations. + */ + @JsonProperty(value = "diskConfigurations") + private List diskConfigurations; + + /** + * Get the diskConfigurations property: Gets the list of Disk Configurations. + * + * @return the diskConfigurations value. + */ + public List diskConfigurations() { + return this.diskConfigurations; + } + + /** + * Set the diskConfigurations property: Gets the list of Disk Configurations. + * + * @param diskConfigurations the diskConfigurations value to set. + * @return the SapDiskConfigurationsResultInner object itself. + */ + public SapDiskConfigurationsResultInner withDiskConfigurations(List diskConfigurations) { + this.diskConfigurations = diskConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskConfigurations() != null) { + diskConfigurations().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..9682dd90d4dd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSizingRecommendationResultInner.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Immutable; +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) +}) +@Immutable +public class SapSizingRecommendationResultInner { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..e670708a56a2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapSupportedResourceSkusResultInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.models.SapSupportedSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of supported SKUs for different resources which are part of SAP deployment. */ +@Fluent +public final class SapSupportedResourceSkusResultInner { + /* + * Gets the list of SAP supported SKUs. + */ + @JsonProperty(value = "supportedSkus") + private List supportedSkus; + + /** + * Get the supportedSkus property: Gets the list of SAP supported SKUs. + * + * @return the supportedSkus value. + */ + public List supportedSkus() { + return this.supportedSkus; + } + + /** + * Set the supportedSkus property: Gets the list of SAP supported SKUs. + * + * @param supportedSkus the supportedSkus value to set. + * @return the SapSupportedResourceSkusResultInner object itself. + */ + public SapSupportedResourceSkusResultInner withSupportedSkus(List supportedSkus) { + this.supportedSkus = supportedSkus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedSkus() != null) { + supportedSkus().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..2b2e4d95186d --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceInner.java @@ -0,0 +1,258 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.SapConfiguration; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHealthState; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; +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.util.Map; + +/** Define the Virtual Instance for SAP. */ +@Fluent +public final class SapVirtualInstanceInner extends Resource { + /* + * Managed service identity (user assigned identities) + */ + @JsonProperty(value = "identity") + private UserAssignedServiceIdentity identity; + + /* + * Defines the Virtual Instance for SAP 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; + + /** + * Get the identity property: Managed service identity (user assigned identities). + * + * @return the identity value. + */ + public UserAssignedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (user assigned identities). + * + * @param identity the identity value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withIdentity(UserAssignedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: Defines the Virtual Instance for SAP properties. + * + * @return the innerProperties value. + */ + private SapVirtualInstanceProperties innerProperties() { + return this.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} */ + @Override + public SapVirtualInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapVirtualInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.innerProperties() == null ? null : this.innerProperties().environment(); + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withEnvironment(SapEnvironmentType environment) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withEnvironment(environment); + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.innerProperties() == null ? null : this.innerProperties().sapProduct(); + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withSapProduct(SapProductType sapProduct) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withSapProduct(sapProduct); + return this; + } + + /** + * Get the configuration property: Defines if an existing SAP system is being registered or a new SAP system is + * being created. + * + * @return the configuration value. + */ + public SapConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Defines if an existing SAP system is being registered or a new SAP system is + * being created. + * + * @param configuration the configuration value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withConfiguration(SapConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the state property: Defines the Virtual Instance for SAP state. + * + * @return the state value. + */ + public SapVirtualInstanceState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the Virtual Instance for SAP errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model SapVirtualInstanceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceInner.class); +} 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 new file mode 100644 index 000000000000..2ea0106371a8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SapVirtualInstanceProperties.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.SapConfiguration; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHealthState; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; +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; + +/** Defines the Virtual Instance for SAP properties. */ +@Fluent +public final class SapVirtualInstanceProperties { + /* + * 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 an existing SAP system is being registered or a new SAP + * system is being created + */ + @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 SAP Instance health. + */ + @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; + + /* + * Defines the Virtual Instance for SAP errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the configuration property: Defines if an existing SAP system is being registered or a new SAP system is + * being created. + * + * @return the configuration value. + */ + public SapConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Defines if an existing SAP system is being registered or a new SAP system is + * being created. + * + * @param configuration the configuration value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withConfiguration(SapConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.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) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the state property: Defines the Virtual Instance for SAP state. + * + * @return the state value. + */ + public SapVirtualInstanceState state() { + return this.state; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the Virtual Instance for SAP errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.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")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapVirtualInstanceProperties")); + } + if (configuration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property configuration in model SapVirtualInstanceProperties")); + } else { + configuration().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (errors() != null) { + errors().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceProperties.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SkuDefinitionInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SkuDefinitionInner.java new file mode 100644 index 000000000000..d6be55901795 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/SkuDefinitionInner.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.SkuCapability; +import com.azure.resourcemanager.workloads.models.SkuCost; +import com.azure.resourcemanager.workloads.models.SkuLocationAndZones; +import com.azure.resourcemanager.workloads.models.SkuRestriction; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SKU definition. */ +@Fluent +public final class SkuDefinitionInner { + /* + * The name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Resource type the SKU applicable for. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /* + * If the service has different kinds of hardware, for the same SKU, then + * that can be captured here. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * List of locations where this SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * List of locations where this SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /* + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Object capacity; + + /* + * The SKU costs. + */ + @JsonProperty(value = "costs") + private List costs; + + /* + * The SKU capabilities. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /* + * The SKU restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resourceType property: Resource type the SKU applicable for. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource type the SKU applicable for. + * + * @param resourceType the resourceType value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the kind property: If the service has different kinds of hardware, for the same SKU, then that can be + * captured here. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: If the service has different kinds of hardware, for the same SKU, then that can be + * captured here. + * + * @param kind the kind value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the locations property: List of locations where this SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: List of locations where this SKU is available. + * + * @param locations the locations value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationInfo property: List of locations where this SKU is available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: List of locations where this SKU is available. + * + * @param locationInfo the locationInfo value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Object capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withCapacity(Object capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the costs property: The SKU costs. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Set the costs property: The SKU costs. + * + * @param costs the costs value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withCosts(List costs) { + this.costs = costs; + return this; + } + + /** + * Get the capabilities property: The SKU capabilities. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The SKU capabilities. + * + * @param capabilities the capabilities value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the restrictions property: The SKU restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: The SKU restrictions. + * + * @param restrictions the restrictions value to set. + * @return the SkuDefinitionInner object itself. + */ + public SkuDefinitionInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SkuDefinitionInner")); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SkuDefinitionInner.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceInner.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceInner.java new file mode 100644 index 000000000000..532596c529a4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.workloads.models.ApplicationProvisioningState; +import com.azure.resourcemanager.workloads.models.WordpressVersions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** WordPress instance resource. */ +@Fluent +public final class WordpressInstanceResourceInner extends ProxyResource { + /* + * Resource properties + */ + @JsonProperty(value = "properties") + private WordpressInstanceResourceProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private WordpressInstanceResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the version property: Application version. + * + * @return the version value. + */ + public WordpressVersions version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Application version. + * + * @param version the version value to set. + * @return the WordpressInstanceResourceInner object itself. + */ + public WordpressInstanceResourceInner withVersion(WordpressVersions version) { + if (this.innerProperties() == null) { + this.innerProperties = new WordpressInstanceResourceProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the databaseName property: Database name used by the application. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.innerProperties() == null ? null : this.innerProperties().databaseName(); + } + + /** + * Set the databaseName property: Database name used by the application. + * + * @param databaseName the databaseName value to set. + * @return the WordpressInstanceResourceInner object itself. + */ + public WordpressInstanceResourceInner withDatabaseName(String databaseName) { + if (this.innerProperties() == null) { + this.innerProperties = new WordpressInstanceResourceProperties(); + } + this.innerProperties().withDatabaseName(databaseName); + return this; + } + + /** + * Get the databaseUser property: User name used by the application to connect to database. + * + * @return the databaseUser value. + */ + public String databaseUser() { + return this.innerProperties() == null ? null : this.innerProperties().databaseUser(); + } + + /** + * Set the databaseUser property: User name used by the application to connect to database. + * + * @param databaseUser the databaseUser value to set. + * @return the WordpressInstanceResourceInner object itself. + */ + public WordpressInstanceResourceInner withDatabaseUser(String databaseUser) { + if (this.innerProperties() == null) { + this.innerProperties = new WordpressInstanceResourceProperties(); + } + this.innerProperties().withDatabaseUser(databaseUser); + return this; + } + + /** + * Get the siteUrl property: Site Url to access the WordPress application. + * + * @return the siteUrl value. + */ + public String siteUrl() { + return this.innerProperties() == null ? null : this.innerProperties().siteUrl(); + } + + /** + * Get the provisioningState property: WordPress instance provisioning state. + * + * @return the provisioningState value. + */ + public ApplicationProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceProperties.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceProperties.java new file mode 100644 index 000000000000..e53546603543 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/fluent/models/WordpressInstanceResourceProperties.java @@ -0,0 +1,139 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.models.ApplicationProvisioningState; +import com.azure.resourcemanager.workloads.models.WordpressVersions; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** WordPress instance properties. */ +@Fluent +public final class WordpressInstanceResourceProperties { + /* + * Application version + */ + @JsonProperty(value = "version", required = true) + private WordpressVersions version; + + /* + * Database name used by the application + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * User name used by the application to connect to database + */ + @JsonProperty(value = "databaseUser") + private String databaseUser; + + /* + * Site Url to access the WordPress application + */ + @JsonProperty(value = "siteUrl", access = JsonProperty.Access.WRITE_ONLY) + private String siteUrl; + + /* + * WordPress instance provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationProvisioningState provisioningState; + + /** + * Get the version property: Application version. + * + * @return the version value. + */ + public WordpressVersions version() { + return this.version; + } + + /** + * Set the version property: Application version. + * + * @param version the version value to set. + * @return the WordpressInstanceResourceProperties object itself. + */ + public WordpressInstanceResourceProperties withVersion(WordpressVersions version) { + this.version = version; + return this; + } + + /** + * Get the databaseName property: Database name used by the application. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name used by the application. + * + * @param databaseName the databaseName value to set. + * @return the WordpressInstanceResourceProperties object itself. + */ + public WordpressInstanceResourceProperties withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the databaseUser property: User name used by the application to connect to database. + * + * @return the databaseUser value. + */ + public String databaseUser() { + return this.databaseUser; + } + + /** + * Set the databaseUser property: User name used by the application to connect to database. + * + * @param databaseUser the databaseUser value to set. + * @return the WordpressInstanceResourceProperties object itself. + */ + public WordpressInstanceResourceProperties withDatabaseUser(String databaseUser) { + this.databaseUser = databaseUser; + return this; + } + + /** + * Get the siteUrl property: Site Url to access the WordPress application. + * + * @return the siteUrl value. + */ + public String siteUrl() { + return this.siteUrl; + } + + /** + * Get the provisioningState property: WordPress instance provisioning state. + * + * @return the provisioningState value. + */ + public ApplicationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property version in model WordpressInstanceResourceProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WordpressInstanceResourceProperties.class); +} 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 9a7eb104c504..acf835e9b6c7 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.workloads.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.MonitorInner; import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; @@ -46,6 +47,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public WorkloadMonitorProvisioningState provisioningState() { return this.innerModel().provisioningState(); } 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 19fbee18ef35..9660eb680664 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 @@ -637,7 +637,7 @@ public Response getByResourceGroupWithResponse( * * @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. + * @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. @@ -694,7 +694,7 @@ private Mono>> createWithResponseAsync( * * @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. + * @param monitorParameter Request body representing a 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. @@ -749,7 +749,7 @@ private Mono>> createWithResponseAsync( * * @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. + * @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. @@ -772,7 +772,7 @@ private PollerFlux, MonitorInner> beginCreateAsync( * * @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. + * @param monitorParameter Request body representing a 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. @@ -797,7 +797,7 @@ private PollerFlux, MonitorInner> beginCreateAsync( * * @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. + * @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. @@ -815,7 +815,7 @@ public SyncPoller, MonitorInner> beginCreate( * * @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. + * @param monitorParameter Request body representing a 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. @@ -834,7 +834,7 @@ public SyncPoller, MonitorInner> beginCreate( * * @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. + * @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. @@ -854,7 +854,7 @@ private Mono createAsync( * * @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. + * @param monitorParameter Request body representing a 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. @@ -875,7 +875,7 @@ private Mono createAsync( * * @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. + * @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. @@ -891,7 +891,7 @@ public MonitorInner create(String resourceGroupName, String monitorName, Monitor * * @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. + * @param monitorParameter Request body representing a 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. @@ -905,7 +905,7 @@ public MonitorInner create( } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -953,7 +953,7 @@ private Mono>> deleteWithResponseAsync(String resource } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1000,7 +1000,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1024,7 +1024,7 @@ private PollerFlux, OperationStatusResult } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1050,7 +1050,7 @@ private PollerFlux, OperationStatusResult } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1066,7 +1066,7 @@ public SyncPoller, OperationStatusResultI } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1083,7 +1083,7 @@ public SyncPoller, OperationStatusResultI } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1098,7 +1098,7 @@ private Mono deleteAsync(String resourceGroupName, S } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1117,7 +1117,7 @@ private Mono deleteAsync( } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1132,7 +1132,7 @@ public OperationStatusResultInner delete(String resourceGroupName, String monito } /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -1148,7 +1148,7 @@ public OperationStatusResultInner delete(String resourceGroupName, String monito } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. @@ -1204,7 +1204,7 @@ private Mono> updateWithResponseAsync( } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. @@ -1258,7 +1258,7 @@ private Mono> updateWithResponseAsync( } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. @@ -1276,7 +1276,7 @@ private Mono updateAsync(String resourceGroupName, String monitorN } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. @@ -1292,7 +1292,7 @@ public MonitorInner update(String resourceGroupName, String monitorName, Tags ta } /** - * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and 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. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadResourceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadResourceImpl.java new file mode 100644 index 000000000000..ac35c5e9aff8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadResourceImpl.java @@ -0,0 +1,348 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import com.azure.resourcemanager.workloads.models.BackupProfile; +import com.azure.resourcemanager.workloads.models.CacheProfile; +import com.azure.resourcemanager.workloads.models.DatabaseProfile; +import com.azure.resourcemanager.workloads.models.FileshareProfile; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkProfile; +import com.azure.resourcemanager.workloads.models.NodeProfile; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBody; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBodyIdentity; +import com.azure.resourcemanager.workloads.models.PhpProfile; +import com.azure.resourcemanager.workloads.models.PhpWorkloadProvisioningState; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResource; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResourceIdentity; +import com.azure.resourcemanager.workloads.models.SearchProfile; +import com.azure.resourcemanager.workloads.models.SiteProfile; +import com.azure.resourcemanager.workloads.models.Sku; +import com.azure.resourcemanager.workloads.models.UserProfile; +import com.azure.resourcemanager.workloads.models.VmssNodesProfile; +import com.azure.resourcemanager.workloads.models.WorkloadKind; +import java.util.Collections; +import java.util.Map; + +public final class PhpWorkloadResourceImpl + implements PhpWorkloadResource, PhpWorkloadResource.Definition, PhpWorkloadResource.Update { + private PhpWorkloadResourceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WorkloadKind kind() { + return this.innerModel().kind(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public PhpWorkloadResourceIdentity identity() { + return this.innerModel().identity(); + } + + public String appLocation() { + return this.innerModel().appLocation(); + } + + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public UserProfile adminUserProfile() { + return this.innerModel().adminUserProfile(); + } + + public VmssNodesProfile webNodesProfile() { + return this.innerModel().webNodesProfile(); + } + + public NodeProfile controllerProfile() { + return this.innerModel().controllerProfile(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public DatabaseProfile databaseProfile() { + return this.innerModel().databaseProfile(); + } + + public SiteProfile siteProfile() { + return this.innerModel().siteProfile(); + } + + public FileshareProfile fileshareProfile() { + return this.innerModel().fileshareProfile(); + } + + public PhpProfile phpProfile() { + return this.innerModel().phpProfile(); + } + + public SearchProfile searchProfile() { + return this.innerModel().searchProfile(); + } + + public CacheProfile cacheProfile() { + return this.innerModel().cacheProfile(); + } + + public BackupProfile backupProfile() { + return this.innerModel().backupProfile(); + } + + public PhpWorkloadProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PhpWorkloadResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String phpWorkloadName; + + private PatchResourceRequestBody updateResourcePatchRequestBody; + + public PhpWorkloadResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PhpWorkloadResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .createOrUpdate(resourceGroupName, phpWorkloadName, this.innerModel(), Context.NONE); + return this; + } + + public PhpWorkloadResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .createOrUpdate(resourceGroupName, phpWorkloadName, this.innerModel(), context); + return this; + } + + PhpWorkloadResourceImpl(String name, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = new PhpWorkloadResourceInner(); + this.serviceManager = serviceManager; + this.phpWorkloadName = name; + } + + public PhpWorkloadResourceImpl update() { + this.updateResourcePatchRequestBody = new PatchResourceRequestBody(); + return this; + } + + public PhpWorkloadResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .updateWithResponse(resourceGroupName, phpWorkloadName, updateResourcePatchRequestBody, Context.NONE) + .getValue(); + return this; + } + + public PhpWorkloadResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .updateWithResponse(resourceGroupName, phpWorkloadName, updateResourcePatchRequestBody, context) + .getValue(); + return this; + } + + PhpWorkloadResourceImpl( + PhpWorkloadResourceInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.phpWorkloadName = Utils.getValueFromIdByName(innerObject.id(), "phpWorkloads"); + } + + public PhpWorkloadResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .getByResourceGroupWithResponse(resourceGroupName, phpWorkloadName, Context.NONE) + .getValue(); + return this; + } + + public PhpWorkloadResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPhpWorkloads() + .getByResourceGroupWithResponse(resourceGroupName, phpWorkloadName, context) + .getValue(); + return this; + } + + public PhpWorkloadResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PhpWorkloadResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PhpWorkloadResourceImpl withKind(WorkloadKind kind) { + this.innerModel().withKind(kind); + return this; + } + + public PhpWorkloadResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateResourcePatchRequestBody.withTags(tags); + return this; + } + } + + public PhpWorkloadResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PhpWorkloadResourceImpl withIdentity(PhpWorkloadResourceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public PhpWorkloadResourceImpl withAppLocation(String appLocation) { + this.innerModel().withAppLocation(appLocation); + return this; + } + + public PhpWorkloadResourceImpl withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + public PhpWorkloadResourceImpl withAdminUserProfile(UserProfile adminUserProfile) { + this.innerModel().withAdminUserProfile(adminUserProfile); + return this; + } + + public PhpWorkloadResourceImpl withWebNodesProfile(VmssNodesProfile webNodesProfile) { + this.innerModel().withWebNodesProfile(webNodesProfile); + return this; + } + + public PhpWorkloadResourceImpl withControllerProfile(NodeProfile controllerProfile) { + this.innerModel().withControllerProfile(controllerProfile); + return this; + } + + public PhpWorkloadResourceImpl withNetworkProfile(NetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public PhpWorkloadResourceImpl withDatabaseProfile(DatabaseProfile databaseProfile) { + this.innerModel().withDatabaseProfile(databaseProfile); + return this; + } + + public PhpWorkloadResourceImpl withSiteProfile(SiteProfile siteProfile) { + this.innerModel().withSiteProfile(siteProfile); + return this; + } + + public PhpWorkloadResourceImpl withFileshareProfile(FileshareProfile fileshareProfile) { + this.innerModel().withFileshareProfile(fileshareProfile); + return this; + } + + public PhpWorkloadResourceImpl withPhpProfile(PhpProfile phpProfile) { + this.innerModel().withPhpProfile(phpProfile); + return this; + } + + public PhpWorkloadResourceImpl withSearchProfile(SearchProfile searchProfile) { + this.innerModel().withSearchProfile(searchProfile); + return this; + } + + public PhpWorkloadResourceImpl withCacheProfile(CacheProfile cacheProfile) { + this.innerModel().withCacheProfile(cacheProfile); + return this; + } + + public PhpWorkloadResourceImpl withBackupProfile(BackupProfile backupProfile) { + this.innerModel().withBackupProfile(backupProfile); + return this; + } + + public PhpWorkloadResourceImpl withIdentity(PatchResourceRequestBodyIdentity identity) { + this.updateResourcePatchRequestBody.withIdentity(identity); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsClientImpl.java new file mode 100644 index 000000000000..cb7d53cac3da --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsClientImpl.java @@ -0,0 +1,1517 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.PhpWorkloadsClient; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBody; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResourceList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PhpWorkloadsClient. */ +public final class PhpWorkloadsClientImpl implements PhpWorkloadsClient { + /** The proxy service used to perform REST calls. */ + private final PhpWorkloadsService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of PhpWorkloadsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PhpWorkloadsClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(PhpWorkloadsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientPhpWorkloads to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientPhpWo") + private interface PhpWorkloadsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/phpWorkloads") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @BodyParam("application/json") PhpWorkloadResourceInner phpWorkloadResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("phpWorkloadName") String phpWorkloadName, + @BodyParam("application/json") PatchResourceRequestBody resourcePatchRequestBody, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @QueryParam("delete-infra") String deleteInfra, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists PHP workload resources for 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 php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists PHP workload resources for 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 php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists PHP workload 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 php workload resource list along with {@link PagedResponse} on 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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())); + } + + /** + * Lists PHP workload 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 php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String phpWorkloadName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String phpWorkloadName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context); + } + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String phpWorkloadName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, phpWorkloadName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhpWorkloadResourceInner getByResourceGroup(String resourceGroupName, String phpWorkloadName) { + return getByResourceGroupAsync(resourceGroupName, phpWorkloadName).block(); + } + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String phpWorkloadName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, phpWorkloadName, context).block(); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (phpWorkloadResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadResource is required and cannot be null.")); + } else { + phpWorkloadResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + phpWorkloadResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (phpWorkloadResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadResource is required and cannot be null.")); + } else { + phpWorkloadResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + phpWorkloadResource, + accept, + context); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PhpWorkloadResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PhpWorkloadResourceInner.class, + PhpWorkloadResourceInner.class, + this.client.getContext()); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PhpWorkloadResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PhpWorkloadResourceInner.class, + PhpWorkloadResourceInner.class, + context); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PhpWorkloadResourceInner> beginCreateOrUpdate( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource).getSyncPoller(); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 php workload resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PhpWorkloadResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource, context) + .getSyncPoller(); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhpWorkloadResourceInner createOrUpdate( + String resourceGroupName, String phpWorkloadName, PhpWorkloadResourceInner phpWorkloadResource) { + return createOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource).block(); + } + + /** + * Create or updated PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param phpWorkloadResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhpWorkloadResourceInner createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + PhpWorkloadResourceInner phpWorkloadResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, phpWorkloadName, phpWorkloadResource, context).block(); + } + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String phpWorkloadName, PatchResourceRequestBody resourcePatchRequestBody) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (resourcePatchRequestBody == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourcePatchRequestBody is required and cannot be null.")); + } else { + resourcePatchRequestBody.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + phpWorkloadName, + resourcePatchRequestBody, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String phpWorkloadName, + PatchResourceRequestBody resourcePatchRequestBody, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (resourcePatchRequestBody == null) { + return Mono + .error( + new IllegalArgumentException("Parameter resourcePatchRequestBody is required and cannot be null.")); + } else { + resourcePatchRequestBody.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + phpWorkloadName, + resourcePatchRequestBody, + accept, + context); + } + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String phpWorkloadName, PatchResourceRequestBody resourcePatchRequestBody) { + return updateWithResponseAsync(resourceGroupName, phpWorkloadName, resourcePatchRequestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhpWorkloadResourceInner update( + String resourceGroupName, String phpWorkloadName, PatchResourceRequestBody resourcePatchRequestBody) { + return updateAsync(resourceGroupName, phpWorkloadName, resourcePatchRequestBody).block(); + } + + /** + * Update PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param resourcePatchRequestBody Workload resource update data. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String phpWorkloadName, + PatchResourceRequestBody resourcePatchRequestBody, + Context context) { + return updateWithResponseAsync(resourceGroupName, phpWorkloadName, resourcePatchRequestBody, context).block(); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String phpWorkloadName, String deleteInfra) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + deleteInfra, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + deleteInfra, + accept, + context); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String phpWorkloadName, String deleteInfra) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, phpWorkloadName, deleteInfra); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, phpWorkloadName, deleteInfra, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String phpWorkloadName, String deleteInfra) { + return beginDeleteAsync(resourceGroupName, phpWorkloadName, deleteInfra).getSyncPoller(); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + return beginDeleteAsync(resourceGroupName, phpWorkloadName, deleteInfra, context).getSyncPoller(); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String phpWorkloadName, String deleteInfra) { + return beginDeleteAsync(resourceGroupName, phpWorkloadName, deleteInfra) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String phpWorkloadName) { + final String deleteInfra = null; + return beginDeleteAsync(resourceGroupName, phpWorkloadName, deleteInfra) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + return beginDeleteAsync(resourceGroupName, phpWorkloadName, deleteInfra, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra) { + deleteAsync(resourceGroupName, phpWorkloadName, deleteInfra).block(); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String phpWorkloadName) { + final String deleteInfra = null; + deleteAsync(resourceGroupName, phpWorkloadName, deleteInfra).block(); + } + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + deleteAsync(resourceGroupName, phpWorkloadName, deleteInfra, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return php workload resource list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsImpl.java new file mode 100644 index 000000000000..b93a4b64f770 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/PhpWorkloadsImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.PhpWorkloadsClient; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResource; +import com.azure.resourcemanager.workloads.models.PhpWorkloads; + +public final class PhpWorkloadsImpl implements PhpWorkloads { + private static final ClientLogger LOGGER = new ClientLogger(PhpWorkloadsImpl.class); + + private final PhpWorkloadsClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public PhpWorkloadsImpl( + PhpWorkloadsClient 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 PhpWorkloadResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PhpWorkloadResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PhpWorkloadResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PhpWorkloadResourceImpl(inner1, this.manager())); + } + + public PhpWorkloadResource getByResourceGroup(String resourceGroupName, String phpWorkloadName) { + PhpWorkloadResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, phpWorkloadName); + if (inner != null) { + return new PhpWorkloadResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String phpWorkloadName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, phpWorkloadName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PhpWorkloadResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra) { + this.serviceClient().delete(resourceGroupName, phpWorkloadName, deleteInfra); + } + + public void delete(String resourceGroupName, String phpWorkloadName) { + this.serviceClient().delete(resourceGroupName, phpWorkloadName); + } + + public void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context) { + this.serviceClient().delete(resourceGroupName, phpWorkloadName, deleteInfra, context); + } + + public PhpWorkloadResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String phpWorkloadName = Utils.getValueFromIdByName(id, "phpWorkloads"); + if (phpWorkloadName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'phpWorkloads'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, phpWorkloadName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String phpWorkloadName = Utils.getValueFromIdByName(id, "phpWorkloads"); + if (phpWorkloadName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'phpWorkloads'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, phpWorkloadName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String phpWorkloadName = Utils.getValueFromIdByName(id, "phpWorkloads"); + if (phpWorkloadName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'phpWorkloads'.", id))); + } + String localDeleteInfra = null; + this.delete(resourceGroupName, phpWorkloadName, localDeleteInfra, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String deleteInfra, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String phpWorkloadName = Utils.getValueFromIdByName(id, "phpWorkloads"); + if (phpWorkloadName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'phpWorkloads'.", id))); + } + this.delete(resourceGroupName, phpWorkloadName, deleteInfra, context); + } + + private PhpWorkloadsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + public PhpWorkloadResourceImpl define(String name) { + return new PhpWorkloadResourceImpl(name, this.manager()); + } +} 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 a0a27a932211..923715092361 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.workloads.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; import com.azure.resourcemanager.workloads.models.ProviderInstance; @@ -34,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public WorkloadMonitorProvisioningState provisioningState() { return this.innerModel().provisioningState(); } 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 a4ac004288a8..9c4673b2a6f2 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 @@ -328,8 +328,8 @@ public PagedIterable list(String resourceGroupName, Strin } /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -337,7 +337,7 @@ public PagedIterable list(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, Monitor name, and + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -384,8 +384,8 @@ private Mono> getWithResponseAsync( } /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -394,7 +394,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, Monitor name, and + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -438,8 +438,8 @@ private Mono> getWithResponseAsync( } /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -447,7 +447,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -458,8 +458,8 @@ private Mono getAsync( } /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -467,7 +467,7 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -476,8 +476,8 @@ public ProviderInstanceInner get(String resourceGroupName, String monitorName, S } /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -486,7 +486,7 @@ public ProviderInstanceInner get(String resourceGroupName, String monitorName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -496,7 +496,7 @@ public Response getWithResponse( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -505,7 +505,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 monitor along with {@link Response} on successful completion of + * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -564,7 +564,7 @@ private Mono>> createWithResponseAsync( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -574,7 +574,7 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 monitor along with {@link Response} on successful completion of + * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -631,7 +631,7 @@ private Mono>> createWithResponseAsync( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -640,7 +640,7 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link PollerFlux} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProviderInstanceInner> beginCreateAsync( @@ -661,7 +661,7 @@ private PollerFlux, ProviderInstanceInner> beg } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -671,7 +671,7 @@ private PollerFlux, ProviderInstanceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link PollerFlux} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProviderInstanceInner> beginCreateAsync( @@ -691,7 +691,7 @@ private PollerFlux, ProviderInstanceInner> beg } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -700,7 +700,7 @@ private PollerFlux, ProviderInstanceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProviderInstanceInner> beginCreate( @@ -713,7 +713,7 @@ public SyncPoller, ProviderInstanceInner> begi } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -723,7 +723,7 @@ public SyncPoller, ProviderInstanceInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a provider instance associated with monitor. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProviderInstanceInner> beginCreate( @@ -738,7 +738,7 @@ public SyncPoller, ProviderInstanceInner> begi } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -747,7 +747,7 @@ public SyncPoller, ProviderInstanceInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 monitor on successful completion of {@link Mono}. + * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -761,7 +761,7 @@ private Mono createAsync( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -771,7 +771,7 @@ 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 a provider instance associated with monitor on successful completion of {@link Mono}. + * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -787,7 +787,7 @@ private Mono createAsync( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -796,7 +796,7 @@ 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 a provider instance associated with monitor. + * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) public ProviderInstanceInner create( @@ -808,7 +808,7 @@ public ProviderInstanceInner create( } /** - * Creates a provider instance for the specified subscription, resource group, 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. @@ -818,7 +818,7 @@ public ProviderInstanceInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 monitor. + * @return a provider instance associated with SAP monitor. */ @ServiceMethod(returns = ReturnType.SINGLE) public ProviderInstanceInner create( @@ -832,7 +832,7 @@ public ProviderInstanceInner create( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -887,7 +887,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -940,7 +940,7 @@ private Mono>> deleteWithResponseAsync( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -966,7 +966,7 @@ private PollerFlux, OperationStatusResult } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -994,7 +994,7 @@ private PollerFlux, OperationStatusResult } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -1011,7 +1011,7 @@ public SyncPoller, OperationStatusResultI } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -1029,7 +1029,7 @@ public SyncPoller, OperationStatusResultI } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -1048,7 +1048,7 @@ private Mono deleteAsync( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -1068,7 +1068,7 @@ private Mono deleteAsync( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -1085,7 +1085,7 @@ public OperationStatusResultInner delete( } /** - * Deletes a provider instance for the specified subscription, resource group, 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. 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 new file mode 100644 index 000000000000..5fe617507960 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,750 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.workloads.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; +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. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** 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.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientResou") + private interface ResourceProvidersService { + @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, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapSizingRecommendationRequest sapSizingRecommendation, + @HeaderParam("Accept") String accept, + Context context); + + @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, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapSupportedSkusRequest sapSupportedSku, + @HeaderParam("Accept") String accept, + Context context); + + @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, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapDiskConfigurationsRequest sapDiskConfigurations, + @HeaderParam("Accept") String accept, + Context context); + + @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, + @BodyParam("application/json") SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get SAP sizing recommendations. + * + * @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 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapSizingRecommendation != null) { + sapSizingRecommendation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + 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. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation 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 sAP sizing recommendations 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapSizingRecommendation != null) { + sapSizingRecommendation.validate(); + } + 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); + } + + /** + * Get SAP sizing recommendations. + * + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSizingRecommendationsAsync( + String location, SapSizingRecommendationRequest sapSizingRecommendation) { + return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP sizing recommendations. + * + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSizingRecommendationsAsync(String location) { + final SapSizingRecommendationRequest sapSizingRecommendation = null; + return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP sizing recommendations. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapSizingRecommendationResultInner sapSizingRecommendations(String location) { + final SapSizingRecommendationRequest sapSizingRecommendation = null; + return sapSizingRecommendationsAsync(location, sapSizingRecommendation).block(); + } + + /** + * Get SAP sizing recommendations. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation 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 sAP sizing recommendations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation, context).block(); + } + + /** + * Get SAP supported SKUs. + * + * @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 sAP supported SKUs along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapSupportedSku != null) { + sapSupportedSku.validate(); + } + final String accept = "application/json"; + return FluxUtil + .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 SAP supported SKUs. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU 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 sAP supported SKUs along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapSupportedSku != null) { + sapSupportedSku.validate(); + } + 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); + } + + /** + * Get SAP supported SKUs. + * + * @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 sAP supported SKUs on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSupportedSkuAsync( + String location, SapSupportedSkusRequest sapSupportedSku) { + return sapSupportedSkuWithResponseAsync(location, sapSupportedSku) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP supported SKUs. + * + * @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 supported SKUs on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSupportedSkuAsync(String location) { + final SapSupportedSkusRequest sapSupportedSku = null; + return sapSupportedSkuWithResponseAsync(location, sapSupportedSku) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP supported SKUs. + * + * @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 supported SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapSupportedResourceSkusResultInner sapSupportedSku(String location) { + final SapSupportedSkusRequest sapSupportedSku = null; + return sapSupportedSkuAsync(location, sapSupportedSku).block(); + } + + /** + * Get SAP supported SKUs. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU 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 sAP supported SKUs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + return sapSupportedSkuWithResponseAsync(location, sapSupportedSku, context).block(); + } + + /** + * Get SAP Disk Configurations. + * + * @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 sAP Disk Configurations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapDiskConfigurations != null) { + sapDiskConfigurations.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + 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 SAP Disk Configurations. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations 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 sAP Disk Configurations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapDiskConfigurations != null) { + sapDiskConfigurations.validate(); + } + 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); + } + + /** + * Get SAP Disk Configurations. + * + * @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 sAP Disk Configurations on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapDiskConfigurationsAsync( + String location, SapDiskConfigurationsRequest sapDiskConfigurations) { + return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP Disk Configurations. + * + * @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 Disk Configurations on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapDiskConfigurationsAsync(String location) { + final SapDiskConfigurationsRequest sapDiskConfigurations = null; + return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP Disk Configurations. + * + * @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 Disk Configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDiskConfigurationsResultInner sapDiskConfigurations(String location) { + final SapDiskConfigurationsRequest sapDiskConfigurations = null; + return sapDiskConfigurationsAsync(location, sapDiskConfigurations).block(); + } + + /** + * Get SAP Disk Configurations. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations 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 sAP Disk Configurations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations, context).block(); + } + + /** + * Get SAP Availability Zone Details. + * + * @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 sAP Availability Zone Details along with {@link Response} on 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapAvailabilityZoneDetails != null) { + sapAvailabilityZoneDetails.validate(); + } + final String accept = "application/json"; + return FluxUtil + .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 SAP Availability Zone Details. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details 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 sAP Availability Zone Details along with {@link Response} on 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.")); + } + if (this.client.getSubscriptionId() == 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.")); + } + if (sapAvailabilityZoneDetails != null) { + sapAvailabilityZoneDetails.validate(); + } + 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); + } + + /** + * Get SAP Availability Zone Details. + * + * @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 sAP Availability Zone Details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapAvailabilityZoneDetailsAsync( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails) { + return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP Availability Zone Details. + * + * @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 Availability Zone Details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapAvailabilityZoneDetailsAsync(String location) { + final SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails = null; + return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP Availability Zone Details. + * + * @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 Availability Zone Details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapAvailabilityZoneDetailsResultInner sapAvailabilityZoneDetails(String location) { + final SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails = null; + return sapAvailabilityZoneDetailsAsync(location, sapAvailabilityZoneDetails).block(); + } + + /** + * Get SAP Availability Zone Details. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details 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 sAP Availability Zone Details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails, context).block(); + } +} 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 new file mode 100644 index 000000000000..a72563be7d6c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/ResourceProvidersImpl.java @@ -0,0 +1,142 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloads.models.ResourceProviders; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsResult; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsResult; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationRequest; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationResult; +import com.azure.resourcemanager.workloads.models.SapSupportedResourceSkusResult; +import com.azure.resourcemanager.workloads.models.SapSupportedSkusRequest; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SapSizingRecommendationResult sapSizingRecommendations(String location) { + SapSizingRecommendationResultInner inner = this.serviceClient().sapSizingRecommendations(location); + if (inner != null) { + return new SapSizingRecommendationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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(), + new SapSizingRecommendationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapSupportedResourceSkusResult sapSupportedSku(String location) { + SapSupportedResourceSkusResultInner inner = this.serviceClient().sapSupportedSku(location); + if (inner != null) { + return new SapSupportedResourceSkusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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(), + new SapSupportedResourceSkusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapDiskConfigurationsResult sapDiskConfigurations(String location) { + SapDiskConfigurationsResultInner inner = this.serviceClient().sapDiskConfigurations(location); + if (inner != null) { + return new SapDiskConfigurationsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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(), + new SapDiskConfigurationsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapAvailabilityZoneDetailsResult sapAvailabilityZoneDetails(String location) { + SapAvailabilityZoneDetailsResultInner inner = this.serviceClient().sapAvailabilityZoneDetails(location); + if (inner != null) { + return new SapAvailabilityZoneDetailsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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(), + new SapAvailabilityZoneDetailsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 000000000000..e698142b6480 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstanceImpl.java @@ -0,0 +1,253 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; +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.azure.resourcemanager.workloads.models.UpdateSapApplicationInstanceRequest; +import java.util.Collections; +import java.util.Map; + +public final class SapApplicationServerInstanceImpl + implements SapApplicationServerInstance, + SapApplicationServerInstance.Definition, + SapApplicationServerInstance.Update { + private SapApplicationServerInstanceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String instanceNo() { + return this.innerModel().instanceNo(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public String kernelVersion() { + return this.innerModel().kernelVersion(); + } + + public String kernelPatch() { + return this.innerModel().kernelPatch(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public Long gatewayPort() { + return this.innerModel().gatewayPort(); + } + + public Long icmHttpPort() { + return this.innerModel().icmHttpPort(); + } + + public Long icmHttpsPort() { + return this.innerModel().icmHttpsPort(); + } + + public String virtualMachineId() { + return this.innerModel().virtualMachineId(); + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapApplicationServerInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String applicationInstanceName; + + private UpdateSapApplicationInstanceRequest updateBody; + + 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); + return this; + } + + public SapApplicationServerInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .create(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.innerModel(), context); + return this; + } + + SapApplicationServerInstanceImpl(String name, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = new SapApplicationServerInstanceInner(); + this.serviceManager = serviceManager; + this.applicationInstanceName = name; + } + + public SapApplicationServerInstanceImpl update() { + this.updateBody = new UpdateSapApplicationInstanceRequest(); + return this; + } + + public SapApplicationServerInstance apply() { + 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); + return this; + } + + 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"); + } + + public SapApplicationServerInstance refresh() { + 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(); + return this; + } + + public SapApplicationServerInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapApplicationServerInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapApplicationServerInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} 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 new file mode 100644 index 000000000000..38c118b94089 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesClientImpl.java @@ -0,0 +1,1639 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstanceList; +import com.azure.resourcemanager.workloads.models.UpdateSapApplicationInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +public final class SapApplicationServerInstancesClientImpl implements SapApplicationServerInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapApplicationServerInstancesService service; + + /** 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.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapApplicationServerInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapAp") + private interface SapApplicationServerInstancesService { + @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, + @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); + + @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, + @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, + Context context); + + @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, + @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); + + @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, + @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); + + @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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server 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 SAP Application Server Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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); + } + + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server 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 SAP Application Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param applicationInstanceName The name of SAP Application Server 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 SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return getAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).block(); + } + + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .block(); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link PollerFlux} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + 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()); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link PollerFlux} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + 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); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link SyncPoller} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .getSyncPoller(); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link SyncPoller} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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 define the SAP Application Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body) { + return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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 define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Puts the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link PollerFlux} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + 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()); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link PollerFlux} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + 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); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link SyncPoller} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .getSyncPoller(); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 the {@link SyncPoller} for polling of define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server 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 define the SAP Application Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final UpdateSapApplicationInstanceRequest body = null; + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Puts 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. + * @param applicationInstanceName The name of SAP Application Server 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 define the SAP Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param body The SAP Application Server 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 Application Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. <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. + * @param applicationInstanceName The name of SAP Application Server 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (applicationInstanceName == 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); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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 {@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()); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 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); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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 {@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 beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).getSyncPoller(); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 applicationInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner delete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).block(); + } + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 applicationInstanceName, Context context) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context).block(); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..742907d46ba0 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapApplicationServerInstancesImpl.java @@ -0,0 +1,233 @@ +// 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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloads.models.OperationStatusResult; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstances; + +public final class SapApplicationServerInstancesImpl implements SapApplicationServerInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapApplicationServerInstancesImpl.class); + + private final SapApplicationServerInstancesClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public SapApplicationServerInstancesImpl( + SapApplicationServerInstancesClient innerClient, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 { + return null; + } + } + + 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(), + new SapApplicationServerInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 { + return null; + } + } + + 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 { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + 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 Utils.mapPage(inner, inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); + } + + public SapApplicationServerInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String applicationInstanceName = Utils.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))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String applicationInstanceName = Utils.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))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + } + + public OperationStatusResult deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String applicationInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE); + } + + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String applicationInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + } + + private SapApplicationServerInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapApplicationServerInstanceImpl define(String name) { + return new SapApplicationServerInstanceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..1eac80588ea3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapAvailabilityZoneDetailsResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZoneDetailsResult; +import com.azure.resourcemanager.workloads.models.SapAvailabilityZonePair; +import java.util.Collections; +import java.util.List; + +public final class SapAvailabilityZoneDetailsResultImpl implements SapAvailabilityZoneDetailsResult { + private SapAvailabilityZoneDetailsResultInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + SapAvailabilityZoneDetailsResultImpl( + SapAvailabilityZoneDetailsResultInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List availabilityZonePairs() { + List inner = this.innerModel().availabilityZonePairs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapAvailabilityZoneDetailsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.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 new file mode 100644 index 000000000000..d41cfcc1d0cc --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesClientImpl.java @@ -0,0 +1,1656 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloads.models.SapCentralInstanceList; +import com.azure.resourcemanager.workloads.models.UpdateSapCentralInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +public final class SapCentralInstancesClientImpl implements SapCentralInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapCentralInstancesService service; + + /** 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.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapCentralInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapCe") + private interface SapCentralInstancesService { + @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, + @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); + + @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, + @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, + Context context); + + @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, + @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, + Context context); + + @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, + @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); + + @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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return getAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).block(); + } + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link PollerFlux} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( + 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()); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link PollerFlux} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( + 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); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link SyncPoller} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).getSyncPoller(); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link SyncPoller} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body) { + return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Puts the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link PollerFlux} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginUpdateAsync( + 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()); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link PollerFlux} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginUpdateAsync( + 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); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link SyncPoller} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).getSyncPoller(); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 the {@link SyncPoller} for polling of define the SAP Central Server Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final UpdateSapCentralInstanceRequest body = null; + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final UpdateSapCentralInstanceRequest body = null; + return updateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Updates the SAP Central Instance. <br><br>This can be used to update tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto generation to work + * correctly. + * @param body The SAP Central Server 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 Server Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName 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, + centralInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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()); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 {@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, 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); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).getSyncPoller(); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 {@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, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).block(); + } + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner delete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Instances along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Instances along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..bf4d47434bc9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralInstancesImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloads.models.OperationStatusResult; +import com.azure.resourcemanager.workloads.models.SapCentralInstances; +import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; + +public final class SapCentralInstancesImpl implements SapCentralInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapCentralInstancesImpl.class); + + private final SapCentralInstancesClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public SapCentralInstancesImpl( + SapCentralInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 { + return null; + } + } + + 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(), + new SapCentralServerInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 { + return null; + } + } + + 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 { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + 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 Utils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); + } + + public SapCentralServerInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String centralInstanceName = Utils.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))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String centralInstanceName = Utils.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))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + } + + public OperationStatusResult deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String centralInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE); + } + + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String centralInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + } + + private SapCentralInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapCentralServerInstanceImpl define(String name) { + return new SapCentralServerInstanceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..f887b4cdd5bd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapCentralServerInstanceImpl.java @@ -0,0 +1,275 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloads.models.CentralServerVmDetails; +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 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.azure.resourcemanager.workloads.models.UpdateSapCentralInstanceRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SapCentralServerInstanceImpl + implements SapCentralServerInstance, SapCentralServerInstance.Definition, SapCentralServerInstance.Update { + private SapCentralServerInstanceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String instanceNo() { + return this.innerModel().instanceNo(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public MessageServerProperties messageServerProperties() { + return this.innerModel().messageServerProperties(); + } + + public EnqueueServerProperties enqueueServerProperties() { + return this.innerModel().enqueueServerProperties(); + } + + public GatewayServerProperties gatewayServerProperties() { + return this.innerModel().gatewayServerProperties(); + } + + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.innerModel().enqueueReplicationServerProperties(); + } + + public String kernelVersion() { + return this.innerModel().kernelVersion(); + } + + public String kernelPatch() { + return this.innerModel().kernelPatch(); + } + + public List vmDetails() { + List inner = this.innerModel().vmDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapCentralServerInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String centralInstanceName; + + private UpdateSapCentralInstanceRequest updateBody; + + 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); + return this; + } + + public SapCentralServerInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .create(resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), context); + return this; + } + + SapCentralServerInstanceImpl(String name, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = new SapCentralServerInstanceInner(); + this.serviceManager = serviceManager; + this.centralInstanceName = name; + } + + public SapCentralServerInstanceImpl update() { + this.updateBody = new UpdateSapCentralInstanceRequest(); + return this; + } + + public SapCentralServerInstance apply() { + 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); + return this; + } + + 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"); + } + + public SapCentralServerInstance refresh() { + 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(); + return this; + } + + public SapCentralServerInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapCentralServerInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapCentralServerInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public SapCentralServerInstanceImpl withMessageServerProperties(MessageServerProperties messageServerProperties) { + this.innerModel().withMessageServerProperties(messageServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + this.innerModel().withEnqueueServerProperties(enqueueServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + this.innerModel().withGatewayServerProperties(gatewayServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + this.innerModel().withEnqueueReplicationServerProperties(enqueueReplicationServerProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} 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 new file mode 100644 index 000000000000..1e6e36fe9a13 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstanceImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloads.models.DatabaseVmDetails; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloads.models.UpdateSapDatabaseInstanceRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SapDatabaseInstanceImpl + implements SapDatabaseInstance, SapDatabaseInstance.Definition, SapDatabaseInstance.Update { + private SapDatabaseInstanceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public String databaseSid() { + return this.innerModel().databaseSid(); + } + + public String databaseType() { + return this.innerModel().databaseType(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public List vmDetails() { + List inner = this.innerModel().vmDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapDatabaseInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String databaseInstanceName; + + private UpdateSapDatabaseInstanceRequest updateBody; + + 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); + return this; + } + + public SapDatabaseInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .create(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), context); + return this; + } + + SapDatabaseInstanceImpl(String name, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = new SapDatabaseInstanceInner(); + this.serviceManager = serviceManager; + this.databaseInstanceName = name; + } + + public SapDatabaseInstanceImpl update() { + this.updateBody = new UpdateSapDatabaseInstanceRequest(); + return this; + } + + public SapDatabaseInstance apply() { + 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); + return this; + } + + 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"); + } + + public SapDatabaseInstance refresh() { + 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(); + return this; + } + + public SapDatabaseInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapDatabaseInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapDatabaseInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} 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 new file mode 100644 index 000000000000..e43f52de2a42 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesClientImpl.java @@ -0,0 +1,1612 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstanceList; +import com.azure.resourcemanager.workloads.models.UpdateSapDatabaseInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +public final class SapDatabaseInstancesClientImpl implements SapDatabaseInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapDatabaseInstancesService service; + + /** 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.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapDatabaseInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapDa") + private interface SapDatabaseInstancesService { + @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, + @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); + + @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, + @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); + + @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, + @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, + Context context); + + @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, + @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); + + @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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return getAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).block(); + } + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link PollerFlux} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( + 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()); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link PollerFlux} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( + 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); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link SyncPoller} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).getSyncPoller(); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link SyncPoller} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body) { + return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Puts the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).block(); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link PollerFlux} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginUpdateAsync( + 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()); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link PollerFlux} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginUpdateAsync( + 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); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link SyncPoller} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).getSyncPoller(); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 the {@link SyncPoller} for polling of define the SAP Database Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final UpdateSapDatabaseInstanceRequest body = null; + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final UpdateSapDatabaseInstanceRequest body = null; + return updateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Puts the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto generation to work correctly. + * @param body The SAP Database Server 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 Database Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).block(); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName 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, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 {@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, 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); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).getSyncPoller(); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 {@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, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).block(); + } + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner delete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..fa2f56928730 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDatabaseInstancesImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloads.models.OperationStatusResult; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstances; + +public final class SapDatabaseInstancesImpl implements SapDatabaseInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapDatabaseInstancesImpl.class); + + private final SapDatabaseInstancesClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public SapDatabaseInstancesImpl( + SapDatabaseInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + 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 { + return null; + } + } + + 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(), + new SapDatabaseInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 { + return null; + } + } + + 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 { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + 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 Utils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); + } + + public SapDatabaseInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String databaseInstanceName = Utils.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))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String databaseInstanceName = Utils.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))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + } + + public OperationStatusResult deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String databaseInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE); + } + + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + String databaseInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + } + + private SapDatabaseInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapDatabaseInstanceImpl define(String name) { + return new SapDatabaseInstanceImpl(name, this.manager()); + } +} 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 new file mode 100644 index 000000000000..259de58effd1 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapDiskConfigurationsResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloads.models.SapDiskConfiguration; +import com.azure.resourcemanager.workloads.models.SapDiskConfigurationsResult; +import java.util.Collections; +import java.util.List; + +public final class SapDiskConfigurationsResultImpl implements SapDiskConfigurationsResult { + private SapDiskConfigurationsResultInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + SapDiskConfigurationsResultImpl( + SapDiskConfigurationsResultInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List diskConfigurations() { + List inner = this.innerModel().diskConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapDiskConfigurationsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 000000000000..87ba28129211 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSizingRecommendationResultImpl.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloads.models.SapSizingRecommendationResult; + +public final class SapSizingRecommendationResultImpl implements SapSizingRecommendationResult { + private SapSizingRecommendationResultInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + SapSizingRecommendationResultImpl( + SapSizingRecommendationResultInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SapSizingRecommendationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 000000000000..d0c1671e9b10 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapSupportedResourceSkusResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloads.models.SapSupportedResourceSkusResult; +import com.azure.resourcemanager.workloads.models.SapSupportedSku; +import java.util.Collections; +import java.util.List; + +public final class SapSupportedResourceSkusResultImpl implements SapSupportedResourceSkusResult { + private SapSupportedResourceSkusResultInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + SapSupportedResourceSkusResultImpl( + SapSupportedResourceSkusResultInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedSkus() { + List inner = this.innerModel().supportedSkus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapSupportedResourceSkusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.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 new file mode 100644 index 000000000000..738e6903068a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstanceImpl.java @@ -0,0 +1,285 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.OperationStatusResult; +import com.azure.resourcemanager.workloads.models.SapConfiguration; +import com.azure.resourcemanager.workloads.models.SapEnvironmentType; +import com.azure.resourcemanager.workloads.models.SapHealthState; +import com.azure.resourcemanager.workloads.models.SapProductType; +import com.azure.resourcemanager.workloads.models.SapVirtualInstance; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceState; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloads.models.StopRequest; +import com.azure.resourcemanager.workloads.models.UpdateSapVirtualInstanceRequest; +import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class SapVirtualInstanceImpl + implements SapVirtualInstance, SapVirtualInstance.Definition, SapVirtualInstance.Update { + private SapVirtualInstanceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public UserAssignedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SapEnvironmentType environment() { + return this.innerModel().environment(); + } + + public SapProductType sapProduct() { + return this.innerModel().sapProduct(); + } + + public SapConfiguration configuration() { + return this.innerModel().configuration(); + } + + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceState state() { + return this.innerModel().state(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapVirtualInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private UpdateSapVirtualInstanceRequest updateBody; + + public SapVirtualInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SapVirtualInstance create() { + 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); + return this; + } + + SapVirtualInstanceImpl(String name, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = new SapVirtualInstanceInner(); + this.serviceManager = serviceManager; + this.sapVirtualInstanceName = name; + } + + public SapVirtualInstanceImpl update() { + this.updateBody = new UpdateSapVirtualInstanceRequest(); + return this; + } + + public SapVirtualInstance apply() { + 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(); + return this; + } + + 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"); + } + + public SapVirtualInstance refresh() { + 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(); + return this; + } + + public OperationStatusResult start() { + return serviceManager.sapVirtualInstances().start(resourceGroupName, sapVirtualInstanceName); + } + + public OperationStatusResult start(Context context) { + return serviceManager.sapVirtualInstances().start(resourceGroupName, sapVirtualInstanceName, context); + } + + public OperationStatusResult stop(StopRequest body) { + return serviceManager.sapVirtualInstances().stop(resourceGroupName, sapVirtualInstanceName, body); + } + + public OperationStatusResult stop() { + return serviceManager.sapVirtualInstances().stop(resourceGroupName, sapVirtualInstanceName); + } + + public OperationStatusResult stop(StopRequest body, Context context) { + return serviceManager.sapVirtualInstances().stop(resourceGroupName, sapVirtualInstanceName, body, context); + } + + public SapVirtualInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapVirtualInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapVirtualInstanceImpl withEnvironment(SapEnvironmentType environment) { + this.innerModel().withEnvironment(environment); + return this; + } + + public SapVirtualInstanceImpl withSapProduct(SapProductType sapProduct) { + this.innerModel().withSapProduct(sapProduct); + return this; + } + + public SapVirtualInstanceImpl withConfiguration(SapConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public SapVirtualInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public SapVirtualInstanceImpl withIdentity(UserAssignedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public SapVirtualInstanceImpl withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} 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 new file mode 100644 index 000000000000..6df70251c954 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesClientImpl.java @@ -0,0 +1,2110 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloads.models.SapVirtualInstanceList; +import com.azure.resourcemanager.workloads.models.StopRequest; +import com.azure.resourcemanager.workloads.models.UpdateSapVirtualInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. */ +public final class SapVirtualInstancesClientImpl implements SapVirtualInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapVirtualInstancesService service; + + /** 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.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapVirtualInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapVi") + private interface SapVirtualInstancesService { + @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, + @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); + + @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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @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}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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, + Context context); + + @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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @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}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/sapVirtualInstances/{sapVirtualInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + 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); + + @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, + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 {@link PollerFlux} for polling of define the Virtual Instance for SAP. + */ + @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()); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 {@link PollerFlux} for polling of define the Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 {@link SyncPoller} for polling of define the Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 {@link SyncPoller} for polling of define the Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + return createAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Creates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Virtual Instance for SAP 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 Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + 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 an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + return getByResourceGroupAsync(resourceGroupName, sapVirtualInstanceName).block(); + } + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context).block(); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Update Virtual Instance for SAP 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 Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Update Virtual Instance for SAP 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 Virtual Instance for SAP along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Update Virtual Instance for SAP 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 Virtual Instance for SAP on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner update(String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + return updateAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Updates an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param body The Update Virtual Instance for SAP 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 Virtual Instance for SAP along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + final String accept = "application/json"; + return FluxUtil + .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 an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, 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); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName).getSyncPoller(); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context).getSyncPoller(); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName).block(); + } + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, Context context) { + return deleteAsync(resourceGroupName, sapVirtualInstanceName, context).block(); + } + + /** + * Gets all Virtual Instances for SAP 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 in a resource group along with {@link PagedResponse} on 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 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 in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 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 in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Virtual Instances for SAP 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 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), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Virtual Instances for SAP 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 in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all Virtual Instances for SAP 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 in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the 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)); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + final String accept = "application/json"; + return FluxUtil + .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 System. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> 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()); + } + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> 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); + } + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginStart( + String resourceGroupName, String sapVirtualInstanceName) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName).getSyncPoller(); + } + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginStart( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, context).getSyncPoller(); + } + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String sapVirtualInstanceName) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName) { + return startAsync(resourceGroupName, sapVirtualInstanceName).block(); + } + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName, Context context) { + return startAsync(resourceGroupName, sapVirtualInstanceName, context).block(); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.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.")); + } + 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); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 {@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) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 {@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) { + 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); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 {@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) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 {@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) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stopAsync(String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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 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() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + return stopAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Stops 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 stop(String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + return stopAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Stops 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. + * @param body The Virtual Instances for SAP 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} 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 new file mode 100644 index 000000000000..5e4aad740b96 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SapVirtualInstancesImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloads.models.OperationStatusResult; +import com.azure.resourcemanager.workloads.models.SapVirtualInstance; +import com.azure.resourcemanager.workloads.models.SapVirtualInstances; +import com.azure.resourcemanager.workloads.models.StopRequest; + +public final class SapVirtualInstancesImpl implements SapVirtualInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstancesImpl.class); + + private final SapVirtualInstancesClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public SapVirtualInstancesImpl( + SapVirtualInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SapVirtualInstance getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + SapVirtualInstanceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new SapVirtualInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + 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(), + new SapVirtualInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationStatusResult deleteByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + OperationStatusResultInner inner = this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult delete(String resourceGroupName, String sapVirtualInstanceName, Context context) { + OperationStatusResultInner inner = + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.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())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.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())); + } + + public OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName) { + OperationStatusResultInner inner = this.serviceClient().start(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName, Context context) { + OperationStatusResultInner inner = + this.serviceClient().start(resourceGroupName, sapVirtualInstanceName, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + OperationStatusResultInner inner = this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName, body); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName) { + OperationStatusResultInner inner = this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 { + return null; + } + } + + public SapVirtualInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); + } + + public OperationStatusResult deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, Context.NONE); + } + + public OperationStatusResult deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.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))); + } + return this.delete(resourceGroupName, sapVirtualInstanceName, context); + } + + private SapVirtualInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapVirtualInstanceImpl define(String name) { + return new SapVirtualInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkuDefinitionImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkuDefinitionImpl.java new file mode 100644 index 000000000000..29baee5f3244 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkuDefinitionImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; +import com.azure.resourcemanager.workloads.models.SkuCapability; +import com.azure.resourcemanager.workloads.models.SkuCost; +import com.azure.resourcemanager.workloads.models.SkuDefinition; +import com.azure.resourcemanager.workloads.models.SkuLocationAndZones; +import com.azure.resourcemanager.workloads.models.SkuRestriction; +import java.util.Collections; +import java.util.List; + +public final class SkuDefinitionImpl implements SkuDefinition { + private SkuDefinitionInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + SkuDefinitionImpl( + SkuDefinitionInner innerObject, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Object capacity() { + return this.innerModel().capacity(); + } + + public List costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..ab2ca866f85e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusClientImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.workloads.fluent.SkusClient; +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; +import com.azure.resourcemanager.workloads.models.SkusListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(WorkloadsClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSkus to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSkus") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/skus") + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.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())); + } + + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available SKUs 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 SKUs 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)); + } + + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs supported by an Azure Resource Provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SKUs supported by an Azure Resource Provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusImpl.java new file mode 100644 index 000000000000..fcf776689912 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/SkusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.SkusClient; +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; +import com.azure.resourcemanager.workloads.models.SkuDefinition; +import com.azure.resourcemanager.workloads.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public SkusImpl(SkusClient 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 SkuDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SkuDefinitionImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstanceResourceImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstanceResourceImpl.java new file mode 100644 index 000000000000..88d0d05fa340 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstanceResourceImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.azure.resourcemanager.workloads.models.ApplicationProvisioningState; +import com.azure.resourcemanager.workloads.models.WordpressInstanceResource; +import com.azure.resourcemanager.workloads.models.WordpressVersions; + +public final class WordpressInstanceResourceImpl implements WordpressInstanceResource { + private WordpressInstanceResourceInner innerObject; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + WordpressInstanceResourceImpl( + WordpressInstanceResourceInner innerObject, + com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public WordpressVersions version() { + return this.innerModel().version(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public String databaseUser() { + return this.innerModel().databaseUser(); + } + + public String siteUrl() { + return this.innerModel().siteUrl(); + } + + public ApplicationProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public WordpressInstanceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesClientImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesClientImpl.java new file mode 100644 index 000000000000..795fe812bda4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesClientImpl.java @@ -0,0 +1,979 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloads.fluent.WordpressInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.azure.resourcemanager.workloads.models.WordpressInstanceResourceList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WordpressInstancesClient. */ +public final class WordpressInstancesClientImpl implements WordpressInstancesClient { + /** The proxy service used to perform REST calls. */ + private final WordpressInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of WordpressInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WordpressInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(WordpressInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientWordpressInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientWordp") + private interface WordpressInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}/wordpressInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}/wordpressInstances/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}/wordpressInstances/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @BodyParam("application/json") WordpressInstanceResourceInner wordpressInstanceResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads" + + "/phpWorkloads/{phpWorkloadName}/wordpressInstances/default") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("phpWorkloadName") String phpWorkloadName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String phpWorkloadName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + resourceGroupName, + phpWorkloadName, + 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 WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String phpWorkloadName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + resourceGroupName, + phpWorkloadName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String phpWorkloadName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, phpWorkloadName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String phpWorkloadName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, phpWorkloadName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String phpWorkloadName) { + return new PagedIterable<>(listAsync(resourceGroupName, phpWorkloadName)); + } + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String phpWorkloadName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, phpWorkloadName, context)); + } + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String phpWorkloadName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String phpWorkloadName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context); + } + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String phpWorkloadName) { + return getWithResponseAsync(resourceGroupName, phpWorkloadName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WordpressInstanceResourceInner get(String resourceGroupName, String phpWorkloadName) { + return getAsync(resourceGroupName, phpWorkloadName).block(); + } + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String phpWorkloadName, Context context) { + return getWithResponseAsync(resourceGroupName, phpWorkloadName, context).block(); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (wordpressInstanceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter wordpressInstanceResource is required and cannot be null.")); + } else { + wordpressInstanceResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + wordpressInstanceResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + if (wordpressInstanceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter wordpressInstanceResource is required and cannot be null.")); + } else { + wordpressInstanceResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + wordpressInstanceResource, + accept, + context); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WordpressInstanceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WordpressInstanceResourceInner.class, + WordpressInstanceResourceInner.class, + this.client.getContext()); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WordpressInstanceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WordpressInstanceResourceInner.class, + WordpressInstanceResourceInner.class, + context); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WordpressInstanceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource).getSyncPoller(); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WordpressInstanceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource, context) + .getSyncPoller(); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WordpressInstanceResourceInner createOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource) { + return createOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource).block(); + } + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WordpressInstanceResourceInner createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, phpWorkloadName, wordpressInstanceResource, context).block(); + } + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String phpWorkloadName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String phpWorkloadName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (phpWorkloadName == null) { + return Mono + .error(new IllegalArgumentException("Parameter phpWorkloadName 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(), + this.client.getApiVersion(), + resourceGroupName, + phpWorkloadName, + accept, + context); + } + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String phpWorkloadName) { + return deleteWithResponseAsync(resourceGroupName, phpWorkloadName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String phpWorkloadName) { + deleteAsync(resourceGroupName, phpWorkloadName).block(); + } + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String phpWorkloadName, Context context) { + return deleteWithResponseAsync(resourceGroupName, phpWorkloadName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesImpl.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesImpl.java new file mode 100644 index 000000000000..5ffb101b156f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/implementation/WordpressInstancesImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloads.fluent.WordpressInstancesClient; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.azure.resourcemanager.workloads.models.WordpressInstanceResource; +import com.azure.resourcemanager.workloads.models.WordpressInstances; + +public final class WordpressInstancesImpl implements WordpressInstances { + private static final ClientLogger LOGGER = new ClientLogger(WordpressInstancesImpl.class); + + private final WordpressInstancesClient innerClient; + + private final com.azure.resourcemanager.workloads.WorkloadsManager serviceManager; + + public WordpressInstancesImpl( + WordpressInstancesClient innerClient, com.azure.resourcemanager.workloads.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String phpWorkloadName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, phpWorkloadName); + return Utils.mapPage(inner, inner1 -> new WordpressInstanceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String phpWorkloadName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, phpWorkloadName, context); + return Utils.mapPage(inner, inner1 -> new WordpressInstanceResourceImpl(inner1, this.manager())); + } + + public WordpressInstanceResource get(String resourceGroupName, String phpWorkloadName) { + WordpressInstanceResourceInner inner = this.serviceClient().get(resourceGroupName, phpWorkloadName); + if (inner != null) { + return new WordpressInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String phpWorkloadName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, phpWorkloadName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WordpressInstanceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WordpressInstanceResource createOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource) { + WordpressInstanceResourceInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, phpWorkloadName, wordpressInstanceResource); + if (inner != null) { + return new WordpressInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public WordpressInstanceResource createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context) { + WordpressInstanceResourceInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, phpWorkloadName, wordpressInstanceResource, context); + if (inner != null) { + return new WordpressInstanceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String phpWorkloadName) { + this.serviceClient().delete(resourceGroupName, phpWorkloadName); + } + + public Response deleteWithResponse(String resourceGroupName, String phpWorkloadName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, phpWorkloadName, context); + } + + private WordpressInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloads.WorkloadsManager manager() { + return this.serviceManager; + } +} 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 9364313ca194..1f739537aae9 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 @@ -24,7 +24,15 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.workloads.fluent.MonitorsClient; import com.azure.resourcemanager.workloads.fluent.OperationsClient; +import com.azure.resourcemanager.workloads.fluent.PhpWorkloadsClient; import com.azure.resourcemanager.workloads.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.workloads.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloads.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloads.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloads.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloads.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloads.fluent.SkusClient; +import com.azure.resourcemanager.workloads.fluent.WordpressInstancesClient; import com.azure.resourcemanager.workloads.fluent.WorkloadsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -110,6 +118,90 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The PhpWorkloadsClient object to access its operations. */ + private final PhpWorkloadsClient phpWorkloads; + + /** + * Gets the PhpWorkloadsClient object to access its operations. + * + * @return the PhpWorkloadsClient object. + */ + public PhpWorkloadsClient getPhpWorkloads() { + return this.phpWorkloads; + } + + /** The WordpressInstancesClient object to access its operations. */ + private final WordpressInstancesClient wordpressInstances; + + /** + * Gets the WordpressInstancesClient object to access its operations. + * + * @return the WordpressInstancesClient object. + */ + public WordpressInstancesClient getWordpressInstances() { + return this.wordpressInstances; + } + + /** 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. */ + 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. */ + 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. */ + 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. */ + private final SapApplicationServerInstancesClient sapApplicationServerInstances; + + /** + * Gets the SapApplicationServerInstancesClient object to access its operations. + * + * @return the SapApplicationServerInstancesClient object. + */ + public SapApplicationServerInstancesClient getSapApplicationServerInstances() { + return this.sapApplicationServerInstances; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -146,6 +238,18 @@ public ProviderInstancesClient getProviderInstances() { return this.providerInstances; } + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + /** * Initializes an instance of WorkloadsClient client. * @@ -169,9 +273,17 @@ public ProviderInstancesClient getProviderInstances() { this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = "2021-12-01-preview"; + this.phpWorkloads = new PhpWorkloadsClientImpl(this); + this.wordpressInstances = new WordpressInstancesClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.sapVirtualInstances = new SapVirtualInstancesClientImpl(this); + this.sapCentralInstances = new SapCentralInstancesClientImpl(this); + this.sapDatabaseInstances = new SapDatabaseInstancesClientImpl(this); + this.sapApplicationServerInstances = new SapApplicationServerInstancesClientImpl(this); this.operations = new OperationsClientImpl(this); this.monitors = new MonitorsClientImpl(this); this.providerInstances = new ProviderInstancesClientImpl(this); + this.skus = new SkusClientImpl(this); } /** diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationProvisioningState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationProvisioningState.java new file mode 100644 index 000000000000..89e8261e63fd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApplicationProvisioningState. */ +public final class ApplicationProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Accepted for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Created for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState CREATED = fromString("Created"); + + /** Static value Succeeded for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Installing for ApplicationProvisioningState. */ + public static final ApplicationProvisioningState INSTALLING = fromString("Installing"); + + /** + * Creates or finds a ApplicationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationProvisioningState. + */ + @JsonCreator + public static ApplicationProvisioningState fromString(String name) { + return fromString(name, ApplicationProvisioningState.class); + } + + /** + * Gets known ApplicationProvisioningState values. + * + * @return known ApplicationProvisioningState values. + */ + public static Collection values() { + return values(ApplicationProvisioningState.class); + } +} 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 new file mode 100644 index 000000000000..a18dc7b7b446 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ApplicationServerConfiguration.java @@ -0,0 +1,117 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the application server configuration. */ +@Fluent +public final class ApplicationServerConfiguration { + /* + * 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; + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the ApplicationServerConfiguration object itself. + */ + public ApplicationServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.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) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of app server instances. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of app server instances. + * + * @param instanceCount the instanceCount value to set. + * @return the ApplicationServerConfiguration object itself. + */ + public ApplicationServerConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * 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")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model" + + " ApplicationServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationServerConfiguration.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/AzureFrontDoorEnabled.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/AzureFrontDoorEnabled.java new file mode 100644 index 000000000000..b6cfc8ee211c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/AzureFrontDoorEnabled.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureFrontDoorEnabled. */ +public final class AzureFrontDoorEnabled extends ExpandableStringEnum { + /** Static value Enabled for AzureFrontDoorEnabled. */ + public static final AzureFrontDoorEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for AzureFrontDoorEnabled. */ + public static final AzureFrontDoorEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a AzureFrontDoorEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFrontDoorEnabled. + */ + @JsonCreator + public static AzureFrontDoorEnabled fromString(String name) { + return fromString(name, AzureFrontDoorEnabled.class); + } + + /** + * Gets known AzureFrontDoorEnabled values. + * + * @return known AzureFrontDoorEnabled values. + */ + public static Collection values() { + return values(AzureFrontDoorEnabled.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/BackupProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/BackupProfile.java new file mode 100644 index 000000000000..11465862d463 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/BackupProfile.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup profile. */ +@Fluent +public final class BackupProfile { + /* + * Whether to enable Azure backup for the workload + */ + @JsonProperty(value = "backupEnabled", required = true) + private EnableBackup backupEnabled; + + /* + * Backup vault resource Id + */ + @JsonProperty(value = "vaultResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String vaultResourceId; + + /** + * Get the backupEnabled property: Whether to enable Azure backup for the workload. + * + * @return the backupEnabled value. + */ + public EnableBackup backupEnabled() { + return this.backupEnabled; + } + + /** + * Set the backupEnabled property: Whether to enable Azure backup for the workload. + * + * @param backupEnabled the backupEnabled value to set. + * @return the BackupProfile object itself. + */ + public BackupProfile withBackupEnabled(EnableBackup backupEnabled) { + this.backupEnabled = backupEnabled; + return this; + } + + /** + * Get the vaultResourceId property: Backup vault resource Id. + * + * @return the vaultResourceId value. + */ + public String vaultResourceId() { + return this.vaultResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupEnabled() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property backupEnabled in model BackupProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BackupProfile.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CacheProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CacheProfile.java new file mode 100644 index 000000000000..5b27b7b8766f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CacheProfile.java @@ -0,0 +1,152 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cache profile. */ +@Fluent +public final class CacheProfile { + /* + * Cache name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Cache SKU name + */ + @JsonProperty(value = "skuName", required = true) + private String skuName; + + /* + * Cache family + */ + @JsonProperty(value = "family", required = true) + private RedisCacheFamily family; + + /* + * Cache capacity + */ + @JsonProperty(value = "capacity", required = true) + private long capacity; + + /* + * Cache resource Id + */ + @JsonProperty(value = "cacheResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String cacheResourceId; + + /** + * Get the name property: Cache name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Cache name. + * + * @param name the name value to set. + * @return the CacheProfile object itself. + */ + public CacheProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the skuName property: Cache SKU name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Set the skuName property: Cache SKU name. + * + * @param skuName the skuName value to set. + * @return the CacheProfile object itself. + */ + public CacheProfile withSkuName(String skuName) { + this.skuName = skuName; + return this; + } + + /** + * Get the family property: Cache family. + * + * @return the family value. + */ + public RedisCacheFamily family() { + return this.family; + } + + /** + * Set the family property: Cache family. + * + * @param family the family value to set. + * @return the CacheProfile object itself. + */ + public CacheProfile withFamily(RedisCacheFamily family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: Cache capacity. + * + * @return the capacity value. + */ + public long capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Cache capacity. + * + * @param capacity the capacity value to set. + * @return the CacheProfile object itself. + */ + public CacheProfile withCapacity(long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the cacheResourceId property: Cache resource Id. + * + * @return the cacheResourceId value. + */ + public String cacheResourceId() { + return this.cacheResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property skuName in model CacheProfile")); + } + if (family() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property family in model CacheProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CacheProfile.class); +} 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 new file mode 100644 index 000000000000..77cc7e198a68 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerConfiguration.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the central server configuration. */ +@Fluent +public final class CentralServerConfiguration { + /* + * 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; + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the CentralServerConfiguration object itself. + */ + public CentralServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.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) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of central server VMs. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of central server VMs. + * + * @param instanceCount the instanceCount value to set. + * @return the CentralServerConfiguration object itself. + */ + public CentralServerConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * 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")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model CentralServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CentralServerConfiguration.class); +} 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 new file mode 100644 index 000000000000..d0d9670805c5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVirtualMachineType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CentralServerVirtualMachineType. */ +public final class CentralServerVirtualMachineType extends ExpandableStringEnum { + /** Static value Primary for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType PRIMARY = fromString("Primary"); + + /** Static value Secondary for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType SECONDARY = fromString("Secondary"); + + /** Static value Unknown for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType UNKNOWN = fromString("Unknown"); + + /** Static value ASCS for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ASCS = fromString("ASCS"); + + /** Static value ERSInactive for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ERSINACTIVE = fromString("ERSInactive"); + + /** Static value ERS for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ERS = fromString("ERS"); + + /** Static value Standby for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType STANDBY = fromString("Standby"); + + /** + * 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() { + return values(CentralServerVirtualMachineType.class); + } +} 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 new file mode 100644 index 000000000000..35c83c1dd6d8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/CentralServerVmDetails.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Central Server VM Details. */ +@Immutable +public final class CentralServerVmDetails { + /* + * 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; + + /** + * Get the type property: Defines the type of central server VM. + * + * @return the type value. + */ + public CentralServerVirtualMachineType type() { + return this.type; + } + + /** + * Get the virtualMachineId property: The virtualMachineId property. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..09b99f23406d --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseConfiguration.java @@ -0,0 +1,141 @@ +// 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.models; + +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. */ +@Fluent +public final class DatabaseConfiguration { + /* + * 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; + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.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) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of database VMs. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of database VMs. + * + * @param instanceCount the instanceCount value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * 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")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model DatabaseConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DatabaseConfiguration.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseProfile.java new file mode 100644 index 000000000000..9d31808e889d --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseProfile.java @@ -0,0 +1,339 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workload database profile. */ +@Fluent +public final class DatabaseProfile { + /* + * Database type + */ + @JsonProperty(value = "type", required = true) + private DatabaseType type; + + /* + * Database server name + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Database version + */ + @JsonProperty(value = "version") + private String version; + + /* + * The name of the server SKU, e.g. Standard_D32s_v4 + */ + @JsonProperty(value = "sku", required = true) + private String sku; + + /* + * Tier of the server SKU + */ + @JsonProperty(value = "tier", required = true) + private DatabaseTier tier; + + /* + * Whether to enable HA for the server + */ + @JsonProperty(value = "haEnabled") + private HAEnabled haEnabled; + + /* + * SKU name for database storage + */ + @JsonProperty(value = "storageSku") + private String storageSku; + + /* + * Database storage size in GB + */ + @JsonProperty(value = "storageInGB") + private Long storageInGB; + + /* + * Storage IOPS for the server + */ + @JsonProperty(value = "storageIops") + private Long storageIops; + + /* + * Backup retention days for the server + */ + @JsonProperty(value = "backupRetentionDays") + private Integer backupRetentionDays; + + /* + * Whether to enable SSL enforcement on the database + */ + @JsonProperty(value = "sslEnforcementEnabled") + private EnableSslEnforcement sslEnforcementEnabled; + + /* + * Azure Database Server resource Id + */ + @JsonProperty(value = "serverResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String serverResourceId; + + /** + * Get the type property: Database type. + * + * @return the type value. + */ + public DatabaseType type() { + return this.type; + } + + /** + * Set the type property: Database type. + * + * @param type the type value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withType(DatabaseType type) { + this.type = type; + return this; + } + + /** + * Get the serverName property: Database server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Database server name. + * + * @param serverName the serverName value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the version property: Database version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Database version. + * + * @param version the version value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the sku property: The name of the server SKU, e.g. Standard_D32s_v4. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The name of the server SKU, e.g. Standard_D32s_v4. + * + * @param sku the sku value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the tier property: Tier of the server SKU. + * + * @return the tier value. + */ + public DatabaseTier tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of the server SKU. + * + * @param tier the tier value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withTier(DatabaseTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the haEnabled property: Whether to enable HA for the server. + * + * @return the haEnabled value. + */ + public HAEnabled haEnabled() { + return this.haEnabled; + } + + /** + * Set the haEnabled property: Whether to enable HA for the server. + * + * @param haEnabled the haEnabled value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withHaEnabled(HAEnabled haEnabled) { + this.haEnabled = haEnabled; + return this; + } + + /** + * Get the storageSku property: SKU name for database storage. + * + * @return the storageSku value. + */ + public String storageSku() { + return this.storageSku; + } + + /** + * Set the storageSku property: SKU name for database storage. + * + * @param storageSku the storageSku value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withStorageSku(String storageSku) { + this.storageSku = storageSku; + return this; + } + + /** + * Get the storageInGB property: Database storage size in GB. + * + * @return the storageInGB value. + */ + public Long storageInGB() { + return this.storageInGB; + } + + /** + * Set the storageInGB property: Database storage size in GB. + * + * @param storageInGB the storageInGB value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withStorageInGB(Long storageInGB) { + this.storageInGB = storageInGB; + return this; + } + + /** + * Get the storageIops property: Storage IOPS for the server. + * + * @return the storageIops value. + */ + public Long storageIops() { + return this.storageIops; + } + + /** + * Set the storageIops property: Storage IOPS for the server. + * + * @param storageIops the storageIops value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withStorageIops(Long storageIops) { + this.storageIops = storageIops; + return this; + } + + /** + * Get the backupRetentionDays property: Backup retention days for the server. + * + * @return the backupRetentionDays value. + */ + public Integer backupRetentionDays() { + return this.backupRetentionDays; + } + + /** + * Set the backupRetentionDays property: Backup retention days for the server. + * + * @param backupRetentionDays the backupRetentionDays value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withBackupRetentionDays(Integer backupRetentionDays) { + this.backupRetentionDays = backupRetentionDays; + return this; + } + + /** + * Get the sslEnforcementEnabled property: Whether to enable SSL enforcement on the database. + * + * @return the sslEnforcementEnabled value. + */ + public EnableSslEnforcement sslEnforcementEnabled() { + return this.sslEnforcementEnabled; + } + + /** + * Set the sslEnforcementEnabled property: Whether to enable SSL enforcement on the database. + * + * @param sslEnforcementEnabled the sslEnforcementEnabled value to set. + * @return the DatabaseProfile object itself. + */ + public DatabaseProfile withSslEnforcementEnabled(EnableSslEnforcement sslEnforcementEnabled) { + this.sslEnforcementEnabled = sslEnforcementEnabled; + return this; + } + + /** + * Get the serverResourceId property: Azure Database Server resource Id. + * + * @return the serverResourceId value. + */ + public String serverResourceId() { + return this.serverResourceId; + } + + /** + * 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 DatabaseProfile")); + } + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model DatabaseProfile")); + } + if (tier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tier in model DatabaseProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DatabaseProfile.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseTier.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseTier.java new file mode 100644 index 000000000000..fe930d44fafd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseTier.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DatabaseTier. */ +public enum DatabaseTier { + /** Enum value Burstable. */ + BURSTABLE("Burstable"), + + /** Enum value GeneralPurpose. */ + GENERAL_PURPOSE("GeneralPurpose"), + + /** Enum value MemoryOptimized. */ + MEMORY_OPTIMIZED("MemoryOptimized"); + + /** The actual serialized value for a DatabaseTier instance. */ + private final String value; + + DatabaseTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseTier instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseTier object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseTier fromString(String value) { + DatabaseTier[] items = DatabaseTier.values(); + for (DatabaseTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseType.java new file mode 100644 index 000000000000..a8386626c931 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseType.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseType. */ +public final class DatabaseType extends ExpandableStringEnum { + /** Static value MySql for DatabaseType. */ + public static final DatabaseType MY_SQL = fromString("MySql"); + + /** + * Creates or finds a DatabaseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseType. + */ + @JsonCreator + public static DatabaseType fromString(String name) { + return fromString(name, DatabaseType.class); + } + + /** + * Gets known DatabaseType values. + * + * @return known DatabaseType values. + */ + public static Collection values() { + return values(DatabaseType.class); + } +} 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 new file mode 100644 index 000000000000..0c564446bf30 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DatabaseVmDetails.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Database VM Details. */ +@Immutable +public final class DatabaseVmDetails { + /* + * 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; + + /** + * Get the virtualMachineId property: The virtualMachineId property. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..b127c7f06b25 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeployerVmPackages.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the url and storage account ID where deployer VM packages are uploaded. */ +@Fluent +public final class DeployerVmPackages { + /* + * 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; + + /** + * Get the url property: The URL to the deployer VM packages file. + * + * @return the url value. + */ + public String url() { + return this.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. + */ + public DeployerVmPackages withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the storageAccountId property: The deployer VM packages storage account id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The deployer VM packages storage account id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DeployerVmPackages object itself. + */ + public DeployerVmPackages withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..67ae81b39f71 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentConfiguration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 Configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Deployment") +@Fluent +public final class DeploymentConfiguration extends SapConfiguration { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the SAP system is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public DeploymentConfiguration withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the infrastructureConfiguration property: The infrastructure configuration. + * + * @return the infrastructureConfiguration value. + */ + public InfrastructureConfiguration infrastructureConfiguration() { + return this.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) { + this.infrastructureConfiguration = infrastructureConfiguration; + return this; + } + + /** + * Get the softwareConfiguration property: The software configuration. + * + * @return the softwareConfiguration value. + */ + public SoftwareConfiguration softwareConfiguration() { + return this.softwareConfiguration; + } + + /** + * Set the softwareConfiguration property: The software configuration. + * + * @param softwareConfiguration the softwareConfiguration value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withSoftwareConfiguration(SoftwareConfiguration softwareConfiguration) { + this.softwareConfiguration = softwareConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (infrastructureConfiguration() != null) { + infrastructureConfiguration().validate(); + } + if (softwareConfiguration() != null) { + softwareConfiguration().validate(); + } + } +} 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 new file mode 100644 index 000000000000..1d519037b8f4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DeploymentWithOSConfiguration.java @@ -0,0 +1,140 @@ +// 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.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") +@Fluent +public final class DeploymentWithOSConfiguration extends SapConfiguration { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the SAP system is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public DeploymentWithOSConfiguration withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the infrastructureConfiguration property: The infrastructure configuration. + * + * @return the infrastructureConfiguration value. + */ + public InfrastructureConfiguration infrastructureConfiguration() { + return this.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) { + this.infrastructureConfiguration = infrastructureConfiguration; + return this; + } + + /** + * Get the softwareConfiguration property: The software configuration. + * + * @return the softwareConfiguration value. + */ + public SoftwareConfiguration softwareConfiguration() { + return this.softwareConfiguration; + } + + /** + * Set the softwareConfiguration property: The software configuration. + * + * @param softwareConfiguration the softwareConfiguration value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withSoftwareConfiguration(SoftwareConfiguration softwareConfiguration) { + this.softwareConfiguration = softwareConfiguration; + return this; + } + + /** + * Get the osSapConfiguration property: The OS and SAP configuration. + * + * @return the osSapConfiguration value. + */ + public OsSapConfiguration osSapConfiguration() { + return this.osSapConfiguration; + } + + /** + * Set the osSapConfiguration property: The OS and SAP configuration. + * + * @param osSapConfiguration the osSapConfiguration value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withOsSapConfiguration(OsSapConfiguration osSapConfiguration) { + this.osSapConfiguration = osSapConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (infrastructureConfiguration() != null) { + infrastructureConfiguration().validate(); + } + if (softwareConfiguration() != null) { + softwareConfiguration().validate(); + } + if (osSapConfiguration() != null) { + osSapConfiguration().validate(); + } + } +} 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 new file mode 100644 index 000000000000..6f0a24103231 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiscoveryConfiguration.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** Discovery Details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Discovery") +@Fluent +public final class DiscoveryConfiguration extends SapConfiguration { + /* + * The virtual machine ID of the Central Server. + */ + @JsonProperty(value = "centralServerVmId") + private String centralServerVmId; + + /* + * The geo-location where the SAP system exists. + */ + @JsonProperty(value = "appLocation", access = JsonProperty.Access.WRITE_ONLY) + private String appLocation; + + /** + * Get the centralServerVmId property: The virtual machine ID of the Central Server. + * + * @return the centralServerVmId value. + */ + public String centralServerVmId() { + return this.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. + */ + public DiscoveryConfiguration withCentralServerVmId(String centralServerVmId) { + this.centralServerVmId = centralServerVmId; + return this; + } + + /** + * Get the appLocation property: The geo-location where the SAP system exists. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskInfo.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskInfo.java new file mode 100644 index 000000000000..930f99c8f8d2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk resource creation details. */ +@Fluent +public final class DiskInfo { + /* + * Storage type + */ + @JsonProperty(value = "storageType", required = true) + private DiskStorageType storageType; + + /* + * Disk size in GB + */ + @JsonProperty(value = "sizeInGB") + private Long sizeInGB; + + /** + * Get the storageType property: Storage type. + * + * @return the storageType value. + */ + public DiskStorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type. + * + * @param storageType the storageType value to set. + * @return the DiskInfo object itself. + */ + public DiskInfo withStorageType(DiskStorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the sizeInGB property: Disk size in GB. + * + * @return the sizeInGB value. + */ + public Long sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Disk size in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the DiskInfo object itself. + */ + public DiskInfo withSizeInGB(Long sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property storageType in model DiskInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskInfo.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskStorageType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskStorageType.java new file mode 100644 index 000000000000..cf45e09d9ef5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/DiskStorageType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DiskStorageType. */ +public enum DiskStorageType { + /** Enum value Premium_LRS. */ + PREMIUM_LRS("Premium_LRS"), + + /** Enum value Standard_LRS. */ + STANDARD_LRS("Standard_LRS"), + + /** Enum value StandardSSD_LRS. */ + STANDARD_SSD_LRS("StandardSSD_LRS"); + + /** The actual serialized value for a DiskStorageType instance. */ + private final String value; + + DiskStorageType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DiskStorageType instance. + * + * @param value the serialized value to parse. + * @return the parsed DiskStorageType object, or null if unable to parse. + */ + @JsonCreator + public static DiskStorageType fromString(String value) { + DiskStorageType[] items = DiskStorageType.values(); + for (DiskStorageType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableBackup.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableBackup.java new file mode 100644 index 000000000000..ae49157d9bf7 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableBackup.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnableBackup. */ +public final class EnableBackup extends ExpandableStringEnum { + /** Static value Enabled for EnableBackup. */ + public static final EnableBackup ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnableBackup. */ + public static final EnableBackup DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnableBackup from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnableBackup. + */ + @JsonCreator + public static EnableBackup fromString(String name) { + return fromString(name, EnableBackup.class); + } + + /** + * Gets known EnableBackup values. + * + * @return known EnableBackup values. + */ + public static Collection values() { + return values(EnableBackup.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableSslEnforcement.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableSslEnforcement.java new file mode 100644 index 000000000000..34d6bf7b47e7 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnableSslEnforcement.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnableSslEnforcement. */ +public final class EnableSslEnforcement extends ExpandableStringEnum { + /** Static value Enabled for EnableSslEnforcement. */ + public static final EnableSslEnforcement ENABLED = fromString("Enabled"); + + /** Static value Disabled for EnableSslEnforcement. */ + public static final EnableSslEnforcement DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EnableSslEnforcement from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnableSslEnforcement. + */ + @JsonCreator + public static EnableSslEnforcement fromString(String name) { + return fromString(name, EnableSslEnforcement.class); + } + + /** + * Gets known EnableSslEnforcement values. + * + * @return known EnableSslEnforcement values. + */ + public static Collection values() { + return values(EnableSslEnforcement.class); + } +} 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 new file mode 100644 index 000000000000..29a163518ca5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP ERS Server properties. */ +@Immutable +public final class EnqueueReplicationServerProperties { + /* + * Defines the type of Enqueue Replication Server. + */ + @JsonProperty(value = "ersVersion", access = JsonProperty.Access.WRITE_ONLY) + private EnqueueReplicationServerType ersVersion; + + /* + * The ERS server instance id. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * The ERS server SAP host name. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The ERS server SAP kernel version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * The ERS server SAP kernel patch. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * The ERS server SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Defines the SAP Instance health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** + * Get the ersVersion property: Defines the type of Enqueue Replication Server. + * + * @return the ersVersion value. + */ + public EnqueueReplicationServerType ersVersion() { + return this.ersVersion; + } + + /** + * Get the instanceNo property: The ERS server instance id. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the hostname property: The ERS server SAP host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the kernelVersion property: The ERS server SAP kernel version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: The ERS server SAP kernel patch. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the ipAddress property: The ERS server SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..1bf293654a8a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueReplicationServerType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnqueueReplicationServerType. */ +public final class EnqueueReplicationServerType extends ExpandableStringEnum { + /** Static value EnqueueReplicator1 for EnqueueReplicationServerType. */ + public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR1 = fromString("EnqueueReplicator1"); + + /** Static value EnqueueReplicator2 for EnqueueReplicationServerType. */ + public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR2 = fromString("EnqueueReplicator2"); + + /** + * 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() { + return values(EnqueueReplicationServerType.class); + } +} 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 new file mode 100644 index 000000000000..c1c7559bee29 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/EnqueueServerProperties.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP enqueue server properties. */ +@Immutable +public final class EnqueueServerProperties { + /* + * The enqueue server SAP host name. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The enqueue server SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The enqueue server Port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Long port; + + /* + * Defines the SAP Instance health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** + * Get the hostname property: The enqueue server SAP host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the ipAddress property: The enqueue server SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the port property: The enqueue server Port. + * + * @return the port value. + */ + public Long port() { + return this.port; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..f2efbbe32138 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ErrorDefinition.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Error definition. */ +@Immutable +public final class ErrorDefinition { + /* + * 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; + + /** + * 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() { + return this.code; + } + + /** + * Get the message property: Description of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the details property: Internal error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareStorageType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareStorageType.java new file mode 100644 index 000000000000..4ca91717dcc1 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareStorageType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FileShareStorageType. */ +public final class FileShareStorageType extends ExpandableStringEnum { + /** Static value Standard_LRS for FileShareStorageType. */ + public static final FileShareStorageType STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Standard_GRS for FileShareStorageType. */ + public static final FileShareStorageType STANDARD_GRS = fromString("Standard_GRS"); + + /** Static value Standard_ZRS for FileShareStorageType. */ + public static final FileShareStorageType STANDARD_ZRS = fromString("Standard_ZRS"); + + /** Static value Premium_LRS for FileShareStorageType. */ + public static final FileShareStorageType PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Creates or finds a FileShareStorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileShareStorageType. + */ + @JsonCreator + public static FileShareStorageType fromString(String name) { + return fromString(name, FileShareStorageType.class); + } + + /** + * Gets known FileShareStorageType values. + * + * @return known FileShareStorageType values. + */ + public static Collection values() { + return values(FileShareStorageType.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareType.java new file mode 100644 index 000000000000..e11552a512df --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileShareType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FileShareType. */ +public final class FileShareType extends ExpandableStringEnum { + /** Static value NfsOnController for FileShareType. */ + public static final FileShareType NFS_ON_CONTROLLER = fromString("NfsOnController"); + + /** Static value AzureFiles for FileShareType. */ + public static final FileShareType AZURE_FILES = fromString("AzureFiles"); + + /** + * Creates or finds a FileShareType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileShareType. + */ + @JsonCreator + public static FileShareType fromString(String name) { + return fromString(name, FileShareType.class); + } + + /** + * Gets known FileShareType values. + * + * @return known FileShareType values. + */ + public static Collection values() { + return values(FileShareType.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileshareProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileshareProfile.java new file mode 100644 index 000000000000..e9dd919f71df --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/FileshareProfile.java @@ -0,0 +1,141 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** File share profile. */ +@Fluent +public final class FileshareProfile { + /* + * Share type + */ + @JsonProperty(value = "shareType", required = true) + private FileShareType shareType; + + /* + * File share backing storage type + */ + @JsonProperty(value = "storageType", required = true) + private FileShareStorageType storageType; + + /* + * File share size in GB + */ + @JsonProperty(value = "shareSizeInGB") + private Long shareSizeInGB; + + /* + * File share storage resource id + */ + @JsonProperty(value = "storageResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String storageResourceId; + + /* + * File share name + */ + @JsonProperty(value = "shareName", access = JsonProperty.Access.WRITE_ONLY) + private String shareName; + + /** + * Get the shareType property: Share type. + * + * @return the shareType value. + */ + public FileShareType shareType() { + return this.shareType; + } + + /** + * Set the shareType property: Share type. + * + * @param shareType the shareType value to set. + * @return the FileshareProfile object itself. + */ + public FileshareProfile withShareType(FileShareType shareType) { + this.shareType = shareType; + return this; + } + + /** + * Get the storageType property: File share backing storage type. + * + * @return the storageType value. + */ + public FileShareStorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: File share backing storage type. + * + * @param storageType the storageType value to set. + * @return the FileshareProfile object itself. + */ + public FileshareProfile withStorageType(FileShareStorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the shareSizeInGB property: File share size in GB. + * + * @return the shareSizeInGB value. + */ + public Long shareSizeInGB() { + return this.shareSizeInGB; + } + + /** + * Set the shareSizeInGB property: File share size in GB. + * + * @param shareSizeInGB the shareSizeInGB value to set. + * @return the FileshareProfile object itself. + */ + public FileshareProfile withShareSizeInGB(Long shareSizeInGB) { + this.shareSizeInGB = shareSizeInGB; + return this; + } + + /** + * Get the storageResourceId property: File share storage resource id. + * + * @return the storageResourceId value. + */ + public String storageResourceId() { + return this.storageResourceId; + } + + /** + * Get the shareName property: File share name. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareType in model FileshareProfile")); + } + if (storageType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property storageType in model FileshareProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FileshareProfile.class); +} 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 new file mode 100644 index 000000000000..eaa20a5d717a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/GatewayServerProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP Gateway Server properties. */ +@Immutable +public final class GatewayServerProperties { + /* + * The gateway Port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Long port; + + /* + * Defines the SAP Instance health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** + * Get the port property: The gateway Port. + * + * @return the port value. + */ + public Long port() { + return this.port; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HAEnabled.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HAEnabled.java new file mode 100644 index 000000000000..b31f156c418a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HAEnabled.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HAEnabled. */ +public final class HAEnabled extends ExpandableStringEnum { + /** Static value Enabled for HAEnabled. */ + public static final HAEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for HAEnabled. */ + public static final HAEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a HAEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding HAEnabled. + */ + @JsonCreator + public static HAEnabled fromString(String name) { + return fromString(name, HAEnabled.class); + } + + /** + * Gets known HAEnabled values. + * + * @return known HAEnabled values. + */ + public static Collection values() { + return values(HAEnabled.class); + } +} 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 new file mode 100644 index 000000000000..6250f7598fd5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilityConfiguration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the high availability configuration. */ +@Fluent +public final class HighAvailabilityConfiguration { + /* + * The high availability type. + */ + @JsonProperty(value = "highAvailabilityType", required = true) + private SapHighAvailabilityType highAvailabilityType; + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the HighAvailabilityConfiguration object itself. + */ + public HighAvailabilityConfiguration withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilityConfiguration.class); +} 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 new file mode 100644 index 000000000000..9cdbb61ed4b9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/HighAvailabilitySoftwareConfiguration.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the HA software configuration. */ +@Fluent +public final class HighAvailabilitySoftwareConfiguration { + /* + * 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; + + /** + * Get the fencingClientId property: The fencing client id. + * + * @return the fencingClientId value. + */ + public String fencingClientId() { + return this.fencingClientId; + } + + /** + * Set the fencingClientId property: The fencing client id. + * + * @param fencingClientId the fencingClientId value to set. + * @return the HighAvailabilitySoftwareConfiguration object itself. + */ + public HighAvailabilitySoftwareConfiguration withFencingClientId(String fencingClientId) { + this.fencingClientId = fencingClientId; + return this; + } + + /** + * 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() { + return this.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. + */ + public HighAvailabilitySoftwareConfiguration withFencingClientPassword(String fencingClientPassword) { + this.fencingClientPassword = fencingClientPassword; + return this; + } + + /** + * 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")); + } + if (fencingClientPassword() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fencingClientPassword in model" + + " HighAvailabilitySoftwareConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilitySoftwareConfiguration.class); +} 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 new file mode 100644 index 000000000000..fd3708883dda --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ImageReference.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the image to use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can + * only be set when you create the scale set. + */ +@Fluent +public final class ImageReference { + /* + * 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; + + /* + * Specifies the version of the platform image or marketplace image used to + * create the 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. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Specifies in decimal numbers, the version of platform image or + * marketplace image used to create the virtual machine. This readonly + * field differs from 'version', only if the value specified in 'version' + * field is 'latest'. + */ + @JsonProperty(value = "exactVersion", access = JsonProperty.Access.WRITE_ONLY) + private String exactVersion; + + /* + * Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + */ + @JsonProperty(value = "sharedGalleryImageId") + private String sharedGalleryImageId; + + /** + * Get the publisher property: The image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The image publisher. + * + * @param publisher the publisher value to set. + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * 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() { + return this.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. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The image SKU. + * + * @param sku the sku value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: Specifies the version of the platform image or marketplace image used to create the + * 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() { + return this.version; + } + + /** + * Set the version property: Specifies the version of the platform image or marketplace image used to create the + * 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. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the exactVersion property: Specifies in decimal numbers, the version of platform image or marketplace image + * used to create the virtual machine. This readonly field differs from 'version', only if the value specified in + * 'version' field is 'latest'. + * + * @return the exactVersion value. + */ + public String exactVersion() { + return this.exactVersion; + } + + /** + * Get the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @return the sharedGalleryImageId value. + */ + public String sharedGalleryImageId() { + return this.sharedGalleryImageId; + } + + /** + * Set the sharedGalleryImageId property: Specified the shared gallery image unique id for vm deployment. This can + * be fetched from shared gallery image GET call. + * + * @param sharedGalleryImageId the sharedGalleryImageId value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSharedGalleryImageId(String sharedGalleryImageId) { + this.sharedGalleryImageId = sharedGalleryImageId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..e2b70e4efc13 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/InfrastructureConfiguration.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +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; + +/** 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) +}) +@Fluent +public class InfrastructureConfiguration { + /* + * The application resource group where SAP system resources will be + * deployed. + */ + @JsonProperty(value = "appResourceGroup", required = true) + private String appResourceGroup; + + /** + * Get the appResourceGroup property: The application resource group where SAP system resources will be deployed. + * + * @return the appResourceGroup value. + */ + public String appResourceGroup() { + return this.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. + */ + public InfrastructureConfiguration withAppResourceGroup(String appResourceGroup) { + this.appResourceGroup = appResourceGroup; + return this; + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InfrastructureConfiguration.class); +} 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 new file mode 100644 index 000000000000..34af30c29289 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LinuxConfiguration.java @@ -0,0 +1,117 @@ +// 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.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; + +/** + * 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 { + /* + * 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; + + /** + * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * 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() { + return this.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. + */ + public LinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the sshKeyPair property: The SSH Key-pair used to authenticate with the VM's. + * + * @return the sshKeyPair value. + */ + public SshKeyPair sshKeyPair() { + return this.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. + */ + public LinuxConfiguration withSshKeyPair(SshKeyPair sshKeyPair) { + this.sshKeyPair = sshKeyPair; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ssh() != null) { + ssh().validate(); + } + if (sshKeyPair() != null) { + sshKeyPair().validate(); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerType.java new file mode 100644 index 000000000000..5c4c012a34d2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LoadBalancerType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerType. */ +public final class LoadBalancerType extends ExpandableStringEnum { + /** Static value ApplicationGateway for LoadBalancerType. */ + public static final LoadBalancerType APPLICATION_GATEWAY = fromString("ApplicationGateway"); + + /** Static value LoadBalancer for LoadBalancerType. */ + public static final LoadBalancerType LOAD_BALANCER = fromString("LoadBalancer"); + + /** + * Creates or finds a LoadBalancerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerType. + */ + @JsonCreator + public static LoadBalancerType fromString(String name) { + return fromString(name, LoadBalancerType.class); + } + + /** + * Gets known LoadBalancerType values. + * + * @return known LoadBalancerType values. + */ + public static Collection values() { + return values(LoadBalancerType.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LocationType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LocationType.java new file mode 100644 index 000000000000..e16107c8bf1c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/LocationType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LocationType. */ +public final class LocationType extends ExpandableStringEnum { + /** Static value Region for LocationType. */ + public static final LocationType REGION = fromString("Region"); + + /** Static value EdgeZone for LocationType. */ + public static final LocationType EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a LocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocationType. + */ + @JsonCreator + public static LocationType fromString(String name) { + return fromString(name, LocationType.class); + } + + /** + * Gets known LocationType values. + * + * @return known LocationType values. + */ + public static Collection values() { + return values(LocationType.class); + } +} 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 new file mode 100644 index 000000000000..1b5b2d1a2903 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ManagedServiceIdentityType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedServiceIdentityType. */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * 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() { + return values(ManagedServiceIdentityType.class); + } +} 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 new file mode 100644 index 000000000000..54d2cf594ad1 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/MessageServerProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP message server properties. */ +@Immutable +public final class MessageServerProperties { + /* + * The message server port. + */ + @JsonProperty(value = "msPort", access = JsonProperty.Access.WRITE_ONLY) + private Long msPort; + + /* + * The message server internal MS port. + */ + @JsonProperty(value = "internalMsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long internalMsPort; + + /* + * The message server http port. + */ + @JsonProperty(value = "httpPort", access = JsonProperty.Access.WRITE_ONLY) + private Long httpPort; + + /* + * The message server https port. + */ + @JsonProperty(value = "httpsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long httpsPort; + + /* + * The message server SAP host name. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The message server IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Defines the SAP Instance health. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** + * Get the msPort property: The message server port. + * + * @return the msPort value. + */ + public Long msPort() { + return this.msPort; + } + + /** + * Get the internalMsPort property: The message server internal MS port. + * + * @return the internalMsPort value. + */ + public Long internalMsPort() { + return this.internalMsPort; + } + + /** + * Get the httpPort property: The message server http port. + * + * @return the httpPort value. + */ + public Long httpPort() { + return this.httpPort; + } + + /** + * Get the httpsPort property: The message server https port. + * + * @return the httpsPort value. + */ + public Long httpsPort() { + return this.httpsPort; + } + + /** + * Get the hostname property: The message server SAP host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the ipAddress property: The message server IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the health property: Defines the SAP Instance health. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 7c0ecf25eb40..39d5dee16326 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.workloads.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.MonitorInner; import java.util.Map; @@ -47,7 +48,14 @@ public interface Monitor { Map tags(); /** - * Gets the provisioningState property: State of provisioning of the monitor. + * 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. */ @@ -61,16 +69,16 @@ public interface Monitor { MonitorPropertiesErrors errors(); /** - * Gets the appLocation property: The monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the monitoring region. + * 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(); /** - * Gets the routingPreference property: Sets the routing preference of the monitor. By default only RFC1918 traffic - * is routed to the customer VNET. + * 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. */ @@ -84,7 +92,7 @@ public interface Monitor { ManagedRGConfiguration managedResourceGroupConfiguration(); /** - * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP * monitoring. * * @return the logAnalyticsWorkspaceArmId value. @@ -99,7 +107,7 @@ public interface Monitor { String monitorSubnet(); /** - * Gets the msiArmId property: The ARM ID of the MSI used for monitoring. + * Gets the msiArmId property: The ARM ID of the MSI used for SAP monitoring. * * @return the msiArmId value. */ @@ -212,11 +220,11 @@ interface WithTags { /** The stage of the Monitor definition allowing to specify appLocation. */ interface WithAppLocation { /** - * Specifies the appLocation property: The monitor resources will be deployed in the monitoring region. The - * subnet region should be same as the monitoring region.. + * 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 monitor resources will be deployed in the monitoring region. The subnet region - * should be same as the 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. * @return the next definition stage. */ WithCreate withAppLocation(String appLocation); @@ -224,11 +232,11 @@ interface WithAppLocation { /** The stage of the Monitor definition allowing to specify routingPreference. */ interface WithRoutingPreference { /** - * Specifies the routingPreference property: Sets the routing preference of the monitor. By default only + * 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 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. * @return the next definition stage. */ WithCreate withRoutingPreference(RoutingPreference routingPreference); @@ -247,9 +255,10 @@ interface WithManagedResourceGroupConfiguration { interface WithLogAnalyticsWorkspaceArmId { /** * Specifies the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used - * for monitoring.. + * for SAP monitoring.. * - * @param logAnalyticsWorkspaceArmId The ARM ID of the Log Analytics Workspace that is used for monitoring. + * @param logAnalyticsWorkspaceArmId The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. * @return the next definition stage. */ WithCreate withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId); 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 2f3b3c5fda90..a57277d2aaba 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 @@ -82,7 +82,7 @@ public interface Monitors { Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -94,7 +94,7 @@ public interface Monitors { OperationStatusResult deleteByResourceGroup(String resourceGroupName, String monitorName); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -132,7 +132,7 @@ public interface Monitors { Response getByIdWithResponse(String id, Context context); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. @@ -143,7 +143,7 @@ public interface Monitors { OperationStatusResult deleteById(String id); /** - * Deletes a SAP monitor with the specified subscription, resource group, and 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. 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 new file mode 100644 index 000000000000..15e93b704aa9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkConfiguration.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the network configuration for SAP infrastructure. */ +@Fluent +public final class NetworkConfiguration { + /* + * Specifies whether a secondary IP address should be added to the network + * interface on all VMs + */ + @JsonProperty(value = "isSecondaryIpEnabled") + private Boolean isSecondaryIpEnabled; + + /** + * Get the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network + * interface on all VMs. + * + * @return the isSecondaryIpEnabled value. + */ + public Boolean isSecondaryIpEnabled() { + return this.isSecondaryIpEnabled; + } + + /** + * Set the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network + * interface on all VMs. + * + * @param isSecondaryIpEnabled the isSecondaryIpEnabled value to set. + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration withIsSecondaryIpEnabled(Boolean isSecondaryIpEnabled) { + this.isSecondaryIpEnabled = isSecondaryIpEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkProfile.java new file mode 100644 index 000000000000..f99e5a21c59a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NetworkProfile.java @@ -0,0 +1,234 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network profile. */ +@Fluent +public final class NetworkProfile { + /* + * Load balancer type + */ + @JsonProperty(value = "loadBalancerType", required = true) + private LoadBalancerType loadBalancerType; + + /* + * Load balancer SKU + */ + @JsonProperty(value = "loadBalancerSku") + private String loadBalancerSku; + + /* + * Load balancer tier + */ + @JsonProperty(value = "loadBalancerTier") + private String loadBalancerTier; + + /* + * Capacity, applicable only for Application Gateway + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /* + * Whether to enable Azure front door + */ + @JsonProperty(value = "azureFrontDoorEnabled") + private AzureFrontDoorEnabled azureFrontDoorEnabled; + + /* + * Virtual network resource Id + */ + @JsonProperty(value = "vNetResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String vNetResourceId; + + /* + * Azure Loadbalancer or ApplicationGateway resource Id + */ + @JsonProperty(value = "loadBalancerResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String loadBalancerResourceId; + + /* + * Azure front door resource id + */ + @JsonProperty(value = "azureFrontDoorResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String azureFrontDoorResourceId; + + /* + * Loadbalancer front-end IP address resource Id + */ + @JsonProperty(value = "frontEndPublicIpResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String frontEndPublicIpResourceId; + + /* + * List of outbound public IP resource IDs + */ + @JsonProperty(value = "outboundPublicIpResourceIds", access = JsonProperty.Access.WRITE_ONLY) + private List outboundPublicIpResourceIds; + + /** + * Get the loadBalancerType property: Load balancer type. + * + * @return the loadBalancerType value. + */ + public LoadBalancerType loadBalancerType() { + return this.loadBalancerType; + } + + /** + * Set the loadBalancerType property: Load balancer type. + * + * @param loadBalancerType the loadBalancerType value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withLoadBalancerType(LoadBalancerType loadBalancerType) { + this.loadBalancerType = loadBalancerType; + return this; + } + + /** + * Get the loadBalancerSku property: Load balancer SKU. + * + * @return the loadBalancerSku value. + */ + public String loadBalancerSku() { + return this.loadBalancerSku; + } + + /** + * Set the loadBalancerSku property: Load balancer SKU. + * + * @param loadBalancerSku the loadBalancerSku value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withLoadBalancerSku(String loadBalancerSku) { + this.loadBalancerSku = loadBalancerSku; + return this; + } + + /** + * Get the loadBalancerTier property: Load balancer tier. + * + * @return the loadBalancerTier value. + */ + public String loadBalancerTier() { + return this.loadBalancerTier; + } + + /** + * Set the loadBalancerTier property: Load balancer tier. + * + * @param loadBalancerTier the loadBalancerTier value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withLoadBalancerTier(String loadBalancerTier) { + this.loadBalancerTier = loadBalancerTier; + return this; + } + + /** + * Get the capacity property: Capacity, applicable only for Application Gateway. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity, applicable only for Application Gateway. + * + * @param capacity the capacity value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the azureFrontDoorEnabled property: Whether to enable Azure front door. + * + * @return the azureFrontDoorEnabled value. + */ + public AzureFrontDoorEnabled azureFrontDoorEnabled() { + return this.azureFrontDoorEnabled; + } + + /** + * Set the azureFrontDoorEnabled property: Whether to enable Azure front door. + * + * @param azureFrontDoorEnabled the azureFrontDoorEnabled value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withAzureFrontDoorEnabled(AzureFrontDoorEnabled azureFrontDoorEnabled) { + this.azureFrontDoorEnabled = azureFrontDoorEnabled; + return this; + } + + /** + * Get the vNetResourceId property: Virtual network resource Id. + * + * @return the vNetResourceId value. + */ + public String vNetResourceId() { + return this.vNetResourceId; + } + + /** + * Get the loadBalancerResourceId property: Azure Loadbalancer or ApplicationGateway resource Id. + * + * @return the loadBalancerResourceId value. + */ + public String loadBalancerResourceId() { + return this.loadBalancerResourceId; + } + + /** + * Get the azureFrontDoorResourceId property: Azure front door resource id. + * + * @return the azureFrontDoorResourceId value. + */ + public String azureFrontDoorResourceId() { + return this.azureFrontDoorResourceId; + } + + /** + * Get the frontEndPublicIpResourceId property: Loadbalancer front-end IP address resource Id. + * + * @return the frontEndPublicIpResourceId value. + */ + public String frontEndPublicIpResourceId() { + return this.frontEndPublicIpResourceId; + } + + /** + * Get the outboundPublicIpResourceIds property: List of outbound public IP resource IDs. + * + * @return the outboundPublicIpResourceIds value. + */ + public List outboundPublicIpResourceIds() { + return this.outboundPublicIpResourceIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property loadBalancerType in model NetworkProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkProfile.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NodeProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NodeProfile.java new file mode 100644 index 000000000000..d386a6eb33d9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/NodeProfile.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VM or VMSS node profile. */ +@Fluent +public class NodeProfile { + /* + * VM or VMSS name + */ + @JsonProperty(value = "name") + private String name; + + /* + * VM SKU for node(s) + */ + @JsonProperty(value = "nodeSku", required = true) + private String nodeSku; + + /* + * OS image used for creating the nodes + */ + @JsonProperty(value = "osImage", required = true) + private OsImageProfile osImage; + + /* + * OS disk details + */ + @JsonProperty(value = "osDisk", required = true) + private DiskInfo osDisk; + + /* + * Data disks details. This property is not in use right now + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /* + * VM/VMSS resource ARM Ids + */ + @JsonProperty(value = "nodeResourceIds", access = JsonProperty.Access.WRITE_ONLY) + private List nodeResourceIds; + + /** + * Get the name property: VM or VMSS name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: VM or VMSS name. + * + * @param name the name value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the nodeSku property: VM SKU for node(s). + * + * @return the nodeSku value. + */ + public String nodeSku() { + return this.nodeSku; + } + + /** + * Set the nodeSku property: VM SKU for node(s). + * + * @param nodeSku the nodeSku value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withNodeSku(String nodeSku) { + this.nodeSku = nodeSku; + return this; + } + + /** + * Get the osImage property: OS image used for creating the nodes. + * + * @return the osImage value. + */ + public OsImageProfile osImage() { + return this.osImage; + } + + /** + * Set the osImage property: OS image used for creating the nodes. + * + * @param osImage the osImage value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withOsImage(OsImageProfile osImage) { + this.osImage = osImage; + return this; + } + + /** + * Get the osDisk property: OS disk details. + * + * @return the osDisk value. + */ + public DiskInfo osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: OS disk details. + * + * @param osDisk the osDisk value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withOsDisk(DiskInfo osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the dataDisks property: Data disks details. This property is not in use right now. + * + * @return the dataDisks value. + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set the dataDisks property: Data disks details. This property is not in use right now. + * + * @param dataDisks the dataDisks value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get the nodeResourceIds property: VM/VMSS resource ARM Ids. + * + * @return the nodeResourceIds value. + */ + public List nodeResourceIds() { + return this.nodeResourceIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodeSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nodeSku in model NodeProfile")); + } + if (osImage() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osImage in model NodeProfile")); + } else { + osImage().validate(); + } + if (osDisk() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osDisk in model NodeProfile")); + } else { + osDisk().validate(); + } + if (dataDisks() != null) { + dataDisks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NodeProfile.class); +} 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 new file mode 100644 index 000000000000..33d4e4de0669 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSConfiguration.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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) +}) +@Immutable +public class OSConfiguration { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageOffer.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageOffer.java new file mode 100644 index 000000000000..672da63d540a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageOffer.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSImageOffer. */ +public final class OSImageOffer extends ExpandableStringEnum { + /** Static value UbuntuServer for OSImageOffer. */ + public static final OSImageOffer UBUNTU_SERVER = fromString("UbuntuServer"); + + /** + * Creates or finds a OSImageOffer from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSImageOffer. + */ + @JsonCreator + public static OSImageOffer fromString(String name) { + return fromString(name, OSImageOffer.class); + } + + /** + * Gets known OSImageOffer values. + * + * @return known OSImageOffer values. + */ + public static Collection values() { + return values(OSImageOffer.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImagePublisher.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImagePublisher.java new file mode 100644 index 000000000000..95155d656ab6 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImagePublisher.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSImagePublisher. */ +public final class OSImagePublisher extends ExpandableStringEnum { + /** Static value Canonical for OSImagePublisher. */ + public static final OSImagePublisher CANONICAL = fromString("Canonical"); + + /** + * Creates or finds a OSImagePublisher from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSImagePublisher. + */ + @JsonCreator + public static OSImagePublisher fromString(String name) { + return fromString(name, OSImagePublisher.class); + } + + /** + * Gets known OSImagePublisher values. + * + * @return known OSImagePublisher values. + */ + public static Collection values() { + return values(OSImagePublisher.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageSku.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageSku.java new file mode 100644 index 000000000000..f7d44922376e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageSku.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSImageSku. */ +public final class OSImageSku extends ExpandableStringEnum { + /** Static value 18.04-LTS for OSImageSku. */ + public static final OSImageSku ONE_EIGHT_ZERO_FOUR_LTS = fromString("18.04-LTS"); + + /** Static value 16.04-LTS for OSImageSku. */ + public static final OSImageSku ONE_SIX_ZERO_FOUR_LTS = fromString("16.04-LTS"); + + /** + * Creates or finds a OSImageSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSImageSku. + */ + @JsonCreator + public static OSImageSku fromString(String name) { + return fromString(name, OSImageSku.class); + } + + /** + * Gets known OSImageSku values. + * + * @return known OSImageSku values. + */ + public static Collection values() { + return values(OSImageSku.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageVersion.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageVersion.java new file mode 100644 index 000000000000..88b7d89945aa --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSImageVersion.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSImageVersion. */ +public final class OSImageVersion extends ExpandableStringEnum { + /** Static value latest for OSImageVersion. */ + public static final OSImageVersion LATEST = fromString("latest"); + + /** + * Creates or finds a OSImageVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSImageVersion. + */ + @JsonCreator + public static OSImageVersion fromString(String name) { + return fromString(name, OSImageVersion.class); + } + + /** + * Gets known OSImageVersion values. + * + * @return known OSImageVersion values. + */ + public static Collection values() { + return values(OSImageVersion.class); + } +} 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 new file mode 100644 index 000000000000..4eb60010cc78 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSProfile.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * 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 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 + * 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; + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **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". <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() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **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". <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. + */ + public OSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <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 + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <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 + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the osConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the osConfiguration value. + */ + public OSConfiguration osConfiguration() { + return this.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. + */ + public OSProfile withOsConfiguration(OSConfiguration osConfiguration) { + this.osConfiguration = osConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osConfiguration() != null) { + osConfiguration().validate(); + } + } +} 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 new file mode 100644 index 000000000000..c35f7fc1ae84 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OSType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSType. */ +public final class OSType extends ExpandableStringEnum { + /** Static value Linux for OSType. */ + public static final OSType LINUX = fromString("Linux"); + + /** Static value Windows for OSType. */ + public static final OSType WINDOWS = fromString("Windows"); + + /** + * Creates 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() { + return values(OSType.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsImageProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsImageProfile.java new file mode 100644 index 000000000000..0a4a5449f7bb --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsImageProfile.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OS image profile. */ +@Fluent +public final class OsImageProfile { + /* + * OS image publisher + */ + @JsonProperty(value = "publisher") + private OSImagePublisher publisher; + + /* + * OS image offer + */ + @JsonProperty(value = "offer") + private OSImageOffer offer; + + /* + * OS image sku + */ + @JsonProperty(value = "sku") + private OSImageSku sku; + + /* + * OS image version + */ + @JsonProperty(value = "version") + private OSImageVersion version; + + /** + * Get the publisher property: OS image publisher. + * + * @return the publisher value. + */ + public OSImagePublisher publisher() { + return this.publisher; + } + + /** + * Set the publisher property: OS image publisher. + * + * @param publisher the publisher value to set. + * @return the OsImageProfile object itself. + */ + public OsImageProfile withPublisher(OSImagePublisher publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: OS image offer. + * + * @return the offer value. + */ + public OSImageOffer offer() { + return this.offer; + } + + /** + * Set the offer property: OS image offer. + * + * @param offer the offer value to set. + * @return the OsImageProfile object itself. + */ + public OsImageProfile withOffer(OSImageOffer offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: OS image sku. + * + * @return the sku value. + */ + public OSImageSku sku() { + return this.sku; + } + + /** + * Set the sku property: OS image sku. + * + * @param sku the sku value to set. + * @return the OsImageProfile object itself. + */ + public OsImageProfile withSku(OSImageSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: OS image version. + * + * @return the version value. + */ + public OSImageVersion version() { + return this.version; + } + + /** + * Set the version property: OS image version. + * + * @param version the version value to set. + * @return the OsImageProfile object itself. + */ + public OsImageProfile withVersion(OSImageVersion version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..0b9c869b92fd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/OsSapConfiguration.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the OS and SAP Configurations for Deployment. */ +@Fluent +public final class OsSapConfiguration { + /* + * 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; + + /** + * Get the deployerVmPackages property: The url and storage account ID where deployer VM packages are uploaded. + * + * @return the deployerVmPackages value. + */ + public DeployerVmPackages deployerVmPackages() { + return this.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. + */ + public OsSapConfiguration withDeployerVmPackages(DeployerVmPackages deployerVmPackages) { + this.deployerVmPackages = deployerVmPackages; + return this; + } + + /** + * Get the sapFqdn property: The FQDN to set for the SAP system. + * + * @return the sapFqdn value. + */ + public String sapFqdn() { + return this.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. + */ + public OsSapConfiguration withSapFqdn(String sapFqdn) { + this.sapFqdn = sapFqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deployerVmPackages() != null) { + deployerVmPackages().validate(); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBody.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBody.java new file mode 100644 index 000000000000..77f1c9831018 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBody.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource patch request body. */ +@Fluent +public final class PatchResourceRequestBody { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private PatchResourceRequestBodyIdentity identity; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PatchResourceRequestBody object itself. + */ + public PatchResourceRequestBody withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public PatchResourceRequestBodyIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the PatchResourceRequestBody object itself. + */ + public PatchResourceRequestBody withIdentity(PatchResourceRequestBodyIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBodyIdentity.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBodyIdentity.java new file mode 100644 index 000000000000..31c4a7f6eff3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PatchResourceRequestBodyIdentity.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** The PatchResourceRequestBodyIdentity model. */ +@Fluent +public class PatchResourceRequestBodyIdentity extends UserAssignedServiceIdentity { + /** {@inheritDoc} */ + @Override + public PatchResourceRequestBodyIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public PatchResourceRequestBodyIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpProfile.java new file mode 100644 index 000000000000..58d19fe6bd25 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpProfile.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** PHP profile. */ +@Fluent +public final class PhpProfile { + /* + * PHP version + */ + @JsonProperty(value = "version", required = true) + private PhpVersion version; + + /** + * Get the version property: PHP version. + * + * @return the version value. + */ + public PhpVersion version() { + return this.version; + } + + /** + * Set the version property: PHP version. + * + * @param version the version value to set. + * @return the PhpProfile object itself. + */ + public PhpProfile withVersion(PhpVersion version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property version in model PhpProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhpProfile.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpVersion.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpVersion.java new file mode 100644 index 000000000000..900ae79d8145 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpVersion.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PhpVersion. */ +public final class PhpVersion extends ExpandableStringEnum { + /** Static value 7.2 for PhpVersion. */ + public static final PhpVersion SEVEN_TWO = fromString("7.2"); + + /** Static value 7.3 for PhpVersion. */ + public static final PhpVersion SEVEN_THREE = fromString("7.3"); + + /** Static value 7.4 for PhpVersion. */ + public static final PhpVersion SEVEN_FOUR = fromString("7.4"); + + /** + * Creates or finds a PhpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding PhpVersion. + */ + @JsonCreator + public static PhpVersion fromString(String name) { + return fromString(name, PhpVersion.class); + } + + /** + * Gets known PhpVersion values. + * + * @return known PhpVersion values. + */ + public static Collection values() { + return values(PhpVersion.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadProvisioningState.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadProvisioningState.java new file mode 100644 index 000000000000..6b5604ddb8e2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PhpWorkloadProvisioningState. */ +public final class PhpWorkloadProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Accepted for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Created for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState CREATED = fromString("Created"); + + /** Static value Succeeded for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Deleting for PhpWorkloadProvisioningState. */ + public static final PhpWorkloadProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a PhpWorkloadProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PhpWorkloadProvisioningState. + */ + @JsonCreator + public static PhpWorkloadProvisioningState fromString(String name) { + return fromString(name, PhpWorkloadProvisioningState.class); + } + + /** + * Gets known PhpWorkloadProvisioningState values. + * + * @return known PhpWorkloadProvisioningState values. + */ + public static Collection values() { + return values(PhpWorkloadProvisioningState.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResource.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResource.java new file mode 100644 index 000000000000..03679cfa7720 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResource.java @@ -0,0 +1,507 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import java.util.Map; + +/** An immutable client-side representation of PhpWorkloadResource. */ +public interface PhpWorkloadResource { + /** + * 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 kind property: Indicates which kind of php workload this resource represent e.g WordPress. + * + * @return the kind value. + */ + WorkloadKind kind(); + + /** + * Gets the sku property: Php workloads SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: Identity for the resource. Currently not supported. + * + * @return the identity value. + */ + PhpWorkloadResourceIdentity identity(); + + /** + * Gets the appLocation property: The infra resources for PHP workload will be created in this location. + * + * @return the appLocation value. + */ + String appLocation(); + + /** + * Gets the managedResourceGroupConfiguration property: Managed resource group configuration of the workload. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedRGConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @return the adminUserProfile value. + */ + UserProfile adminUserProfile(); + + /** + * Gets the webNodesProfile property: VMSS web nodes profile. + * + * @return the webNodesProfile value. + */ + VmssNodesProfile webNodesProfile(); + + /** + * Gets the controllerProfile property: Controller VM profile. + * + * @return the controllerProfile value. + */ + NodeProfile controllerProfile(); + + /** + * Gets the networkProfile property: Network profile. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the databaseProfile property: Database profile. + * + * @return the databaseProfile value. + */ + DatabaseProfile databaseProfile(); + + /** + * Gets the siteProfile property: Site profile. + * + * @return the siteProfile value. + */ + SiteProfile siteProfile(); + + /** + * Gets the fileshareProfile property: File share profile. + * + * @return the fileshareProfile value. + */ + FileshareProfile fileshareProfile(); + + /** + * Gets the phpProfile property: PHP profile. + * + * @return the phpProfile value. + */ + PhpProfile phpProfile(); + + /** + * Gets the searchProfile property: Search profile. + * + * @return the searchProfile value. + */ + SearchProfile searchProfile(); + + /** + * Gets the cacheProfile property: Cache profile. + * + * @return the cacheProfile value. + */ + CacheProfile cacheProfile(); + + /** + * Gets the backupProfile property: Backup profile. + * + * @return the backupProfile value. + */ + BackupProfile backupProfile(); + + /** + * Gets the provisioningState property: Php workload resource provisioning state. + * + * @return the provisioningState value. + */ + PhpWorkloadProvisioningState provisioningState(); + + /** + * 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.PhpWorkloadResourceInner object. + * + * @return the inner object. + */ + PhpWorkloadResourceInner innerModel(); + + /** The entirety of the PhpWorkloadResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + /** The PhpWorkloadResource definition stages. */ + interface DefinitionStages { + /** The first stage of the PhpWorkloadResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PhpWorkloadResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PhpWorkloadResource 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. + */ + WithKind withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the PhpWorkloadResource definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: Indicates which kind of php workload this resource represent e.g WordPress. + * + * @param kind Indicates which kind of php workload this resource represent e.g WordPress. + * @return the next definition stage. + */ + WithCreate withKind(WorkloadKind kind); + } + /** + * The stage of the PhpWorkloadResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithIdentity, + DefinitionStages.WithAppLocation, + DefinitionStages.WithManagedResourceGroupConfiguration, + DefinitionStages.WithAdminUserProfile, + DefinitionStages.WithWebNodesProfile, + DefinitionStages.WithControllerProfile, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithDatabaseProfile, + DefinitionStages.WithSiteProfile, + DefinitionStages.WithFileshareProfile, + DefinitionStages.WithPhpProfile, + DefinitionStages.WithSearchProfile, + DefinitionStages.WithCacheProfile, + DefinitionStages.WithBackupProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + PhpWorkloadResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PhpWorkloadResource create(Context context); + } + /** The stage of the PhpWorkloadResource 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 PhpWorkloadResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Php workloads SKU. + * + * @param sku Php workloads SKU. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the PhpWorkloadResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource. Currently not supported. + * + * @param identity Identity for the resource. Currently not supported. + * @return the next definition stage. + */ + WithCreate withIdentity(PhpWorkloadResourceIdentity identity); + } + /** The stage of the PhpWorkloadResource definition allowing to specify appLocation. */ + interface WithAppLocation { + /** + * Specifies the appLocation property: The infra resources for PHP workload will be created in this + * location. + * + * @param appLocation The infra resources for PHP workload will be created in this location. + * @return the next definition stage. + */ + WithCreate withAppLocation(String appLocation); + } + /** The stage of the PhpWorkloadResource definition allowing to specify managedResourceGroupConfiguration. */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: Managed resource group configuration of the + * workload. + * + * @param managedResourceGroupConfiguration Managed resource group configuration of the workload. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration); + } + /** The stage of the PhpWorkloadResource definition allowing to specify adminUserProfile. */ + interface WithAdminUserProfile { + /** + * Specifies the adminUserProfile property: Admin user profile used for VM and VMSS. + * + * @param adminUserProfile Admin user profile used for VM and VMSS. + * @return the next definition stage. + */ + WithCreate withAdminUserProfile(UserProfile adminUserProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify webNodesProfile. */ + interface WithWebNodesProfile { + /** + * Specifies the webNodesProfile property: VMSS web nodes profile. + * + * @param webNodesProfile VMSS web nodes profile. + * @return the next definition stage. + */ + WithCreate withWebNodesProfile(VmssNodesProfile webNodesProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify controllerProfile. */ + interface WithControllerProfile { + /** + * Specifies the controllerProfile property: Controller VM profile. + * + * @param controllerProfile Controller VM profile. + * @return the next definition stage. + */ + WithCreate withControllerProfile(NodeProfile controllerProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Network profile. + * + * @param networkProfile Network profile. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(NetworkProfile networkProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify databaseProfile. */ + interface WithDatabaseProfile { + /** + * Specifies the databaseProfile property: Database profile. + * + * @param databaseProfile Database profile. + * @return the next definition stage. + */ + WithCreate withDatabaseProfile(DatabaseProfile databaseProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify siteProfile. */ + interface WithSiteProfile { + /** + * Specifies the siteProfile property: Site profile. + * + * @param siteProfile Site profile. + * @return the next definition stage. + */ + WithCreate withSiteProfile(SiteProfile siteProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify fileshareProfile. */ + interface WithFileshareProfile { + /** + * Specifies the fileshareProfile property: File share profile. + * + * @param fileshareProfile File share profile. + * @return the next definition stage. + */ + WithCreate withFileshareProfile(FileshareProfile fileshareProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify phpProfile. */ + interface WithPhpProfile { + /** + * Specifies the phpProfile property: PHP profile. + * + * @param phpProfile PHP profile. + * @return the next definition stage. + */ + WithCreate withPhpProfile(PhpProfile phpProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify searchProfile. */ + interface WithSearchProfile { + /** + * Specifies the searchProfile property: Search profile. + * + * @param searchProfile Search profile. + * @return the next definition stage. + */ + WithCreate withSearchProfile(SearchProfile searchProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify cacheProfile. */ + interface WithCacheProfile { + /** + * Specifies the cacheProfile property: Cache profile. + * + * @param cacheProfile Cache profile. + * @return the next definition stage. + */ + WithCreate withCacheProfile(CacheProfile cacheProfile); + } + /** The stage of the PhpWorkloadResource definition allowing to specify backupProfile. */ + interface WithBackupProfile { + /** + * Specifies the backupProfile property: Backup profile. + * + * @param backupProfile Backup profile. + * @return the next definition stage. + */ + WithCreate withBackupProfile(BackupProfile backupProfile); + } + } + /** + * Begins update for the PhpWorkloadResource resource. + * + * @return the stage of resource update. + */ + PhpWorkloadResource.Update update(); + + /** The template for PhpWorkloadResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PhpWorkloadResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PhpWorkloadResource apply(Context context); + } + /** The PhpWorkloadResource update stages. */ + interface UpdateStages { + /** The stage of the PhpWorkloadResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PhpWorkloadResource update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity property.. + * + * @param identity The identity property. + * @return the next definition stage. + */ + Update withIdentity(PatchResourceRequestBodyIdentity identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PhpWorkloadResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PhpWorkloadResource refresh(Context context); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceIdentity.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceIdentity.java new file mode 100644 index 000000000000..af481a97b20b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceIdentity.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** Identity for the resource. Currently not supported. */ +@Fluent +public class PhpWorkloadResourceIdentity extends UserAssignedServiceIdentity { + /** {@inheritDoc} */ + @Override + public PhpWorkloadResourceIdentity withType(ManagedServiceIdentityType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public PhpWorkloadResourceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + super.withUserAssignedIdentities(userAssignedIdentities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceList.java new file mode 100644 index 000000000000..4ce745345202 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloadResourceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.PhpWorkloadResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Php workload resource list. */ +@Fluent +public final class PhpWorkloadResourceList { + /* + * List of resources in current page + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to next page of resources + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of resources in current page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources in current page. + * + * @param value the value value to set. + * @return the PhpWorkloadResourceList object itself. + */ + public PhpWorkloadResourceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the PhpWorkloadResourceList object itself. + */ + public PhpWorkloadResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloads.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloads.java new file mode 100644 index 000000000000..0f64d6433ca7 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/PhpWorkloads.java @@ -0,0 +1,170 @@ +// 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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PhpWorkloads. */ +public interface PhpWorkloads { + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists PHP workload resources for 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists PHP workload 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 php workload resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource. + */ + PhpWorkloadResource getByResourceGroup(String resourceGroupName, String phpWorkloadName); + + /** + * Gets the PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the PHP workload resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String phpWorkloadName); + + /** + * Delete PHP workload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + void delete(String resourceGroupName, String phpWorkloadName, String deleteInfra, Context context); + + /** + * Gets the PHP workload 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 PHP workload resource along with {@link Response}. + */ + PhpWorkloadResource getById(String id); + + /** + * Gets the PHP workload 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 PHP workload resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete PHP workload 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. + */ + void deleteById(String id); + + /** + * Delete PHP workload resource. + * + * @param id the resource ID. + * @param deleteInfra Whether to delete infra along with workload 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. + */ + void deleteByIdWithResponse(String id, String deleteInfra, Context context); + + /** + * Begins definition for a new PhpWorkloadResource resource. + * + * @param name resource name. + * @return the first stage of the new PhpWorkloadResource definition. + */ + PhpWorkloadResource.DefinitionStages.Blank define(String name); +} 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 b9fc8b410f52..f5f6644ee793 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.workloads.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.workloads.fluent.models.ProviderInstanceInner; @@ -30,6 +31,13 @@ public interface ProviderInstance { */ 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 provider instance. * 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 d1953abd7891..ca34935f32d6 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 @@ -40,8 +40,8 @@ public interface ProviderInstances { PagedIterable list(String resourceGroupName, String monitorName, Context context); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -49,14 +49,14 @@ public interface ProviderInstances { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name. */ ProviderInstance get(String resourceGroupName, String monitorName, String providerInstanceName); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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. @@ -65,14 +65,14 @@ public interface ProviderInstances { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String monitorName, String providerInstanceName, Context context); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -85,7 +85,7 @@ Response getWithResponse( OperationStatusResult delete(String resourceGroupName, String monitorName, String providerInstanceName); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -100,34 +100,34 @@ OperationStatusResult delete( String resourceGroupName, String monitorName, String providerInstanceName, Context context); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name along with {@link Response}. */ ProviderInstance getById(String id); /** - * Gets properties of a provider instance for the specified subscription, resource group, Monitor name, and resource - * name. + * 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, Monitor name, and + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and * resource name along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Deletes a provider instance for the specified subscription, resource group, 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. @@ -138,7 +138,7 @@ OperationStatusResult delete( OperationStatusResult deleteById(String id); /** - * Deletes a provider instance for the specified subscription, resource group, 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. diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RedisCacheFamily.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RedisCacheFamily.java new file mode 100644 index 000000000000..faad2e14f393 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/RedisCacheFamily.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RedisCacheFamily. */ +public final class RedisCacheFamily extends ExpandableStringEnum { + /** Static value C for RedisCacheFamily. */ + public static final RedisCacheFamily C = fromString("C"); + + /** Static value P for RedisCacheFamily. */ + public static final RedisCacheFamily P = fromString("P"); + + /** + * Creates or finds a RedisCacheFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedisCacheFamily. + */ + @JsonCreator + public static RedisCacheFamily fromString(String name) { + return fromString(name, RedisCacheFamily.class); + } + + /** + * Gets known RedisCacheFamily values. + * + * @return known RedisCacheFamily values. + */ + public static Collection values() { + return values(RedisCacheFamily.class); + } +} 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 new file mode 100644 index 000000000000..c3e6dcd1aca8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ResourceProviders.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Get SAP sizing recommendations. + * + * @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. + */ + SapSizingRecommendationResult sapSizingRecommendations(String location); + + /** + * Get SAP sizing recommendations. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + + /** + * Get SAP supported SKUs. + * + * @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 supported SKUs. + */ + SapSupportedResourceSkusResult sapSupportedSku(String location); + + /** + * Get SAP supported SKUs. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 supported SKUs along with {@link Response}. + */ + Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context); + + /** + * Get SAP Disk Configurations. + * + * @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 Disk Configurations. + */ + SapDiskConfigurationsResult sapDiskConfigurations(String location); + + /** + * Get SAP Disk Configurations. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk Configurations along with {@link Response}. + */ + Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + + /** + * Get SAP Availability Zone Details. + * + * @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 Availability Zone Details. + */ + SapAvailabilityZoneDetailsResult sapAvailabilityZoneDetails(String location); + + /** + * Get SAP Availability Zone Details. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Availability Zone Details along with {@link Response}. + */ + Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); +} 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 new file mode 100644 index 000000000000..48e7d155fd17 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstance.java @@ -0,0 +1,306 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import java.util.Map; + +/** 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: The application server instance id. + * + * @return the instanceNo value. + */ + String instanceNo(); + + /** + * Gets the subnet property: The application server subnet. + * + * @return the subnet value. + */ + String subnet(); + + /** + * Gets the hostname property: The application server SAP host name. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the kernelVersion property: The application server SAP kernel version. + * + * @return the kernelVersion value. + */ + String kernelVersion(); + + /** + * Gets the kernelPatch property: The application server SAP kernel patch. + * + * @return the kernelPatch value. + */ + String kernelPatch(); + + /** + * Gets the ipAddress property: The application server SAP IP Address. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the gatewayPort property: The application server gateway Port. + * + * @return the gatewayPort value. + */ + Long gatewayPort(); + + /** + * Gets the icmHttpPort property: The application server ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + Long icmHttpPort(); + + /** + * Gets the icmHttpsPort property: The application server ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + Long icmHttpsPort(); + + /** + * Gets the virtualMachineId property: The virtual machine. + * + * @return the virtualMachineId value. + */ + String virtualMachineId(); + + /** + * Gets the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + SapVirtualInstanceStatus status(); + + /** + * Gets the health property: Defines the SAP Instance health. + * + * @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 SapApplicationServerInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapApplicationServerInstance definition. */ + interface Blank extends WithLocation { + } + /** 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the 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. + * @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. + */ + 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. */ + 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. */ + 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. */ + interface UpdateStages { + /** 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. + */ + SapApplicationServerInstance refresh(Context context); +} 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 new file mode 100644 index 000000000000..b857f33af17a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstanceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.SapApplicationServerInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Application Server Instances. */ +@Fluent +public final class SapApplicationServerInstanceList { + /* + * Gets the list of SAP Application Server instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets the list of SAP Application Server instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP Application Server instances. + * + * @param value the value value to set. + * @return the SapApplicationServerInstanceList object itself. + */ + public SapApplicationServerInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapApplicationServerInstanceList object itself. + */ + public SapApplicationServerInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..6e44ba72ed88 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapApplicationServerInstances.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapApplicationServerInstances. */ +public interface SapApplicationServerInstances { + /** + * Gets 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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + SapApplicationServerInstance get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Gets 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. + * @param applicationInstanceName The name of 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of SAP Application Server instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance. <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. + * @param applicationInstanceName The name of 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. + * @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); + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Application server Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets the SAP Application Server 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance along with {@link Response}. + */ + SapApplicationServerInstance getById(String id); + + /** + * Gets the SAP Application Server Instance. + * + * @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 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the SAP Application Server Instance. <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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult deleteById(String id); + + /** + * Deletes the SAP Application Server Instance. <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. + * @throws com.azure.core.management.exception.ManagementException 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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapApplicationServerInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapApplicationServerInstance definition. + */ + SapApplicationServerInstance.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 000000000000..c4a2d78fe5a8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsRequest.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of availability zones. */ +@Fluent +public final class SapAvailabilityZoneDetailsRequest { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the SAP resources will be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public SapAvailabilityZoneDetailsRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapAvailabilityZoneDetailsRequest object itself. + */ + public SapAvailabilityZoneDetailsRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapAvailabilityZoneDetailsRequest object itself. + */ + public SapAvailabilityZoneDetailsRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * 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")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapAvailabilityZoneDetailsRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapAvailabilityZoneDetailsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapAvailabilityZoneDetailsRequest.class); +} 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 new file mode 100644 index 000000000000..78e3cd511aa8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZoneDetailsResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.resourcemanager.workloads.fluent.models.SapAvailabilityZoneDetailsResultInner; +import java.util.List; + +/** 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 new file mode 100644 index 000000000000..4d27eb2bc81b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapAvailabilityZonePair.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP Availability Zone Pair. */ +@Fluent +public final class SapAvailabilityZonePair { + /* + * The zone A. + */ + @JsonProperty(value = "zoneA") + private Long zoneA; + + /* + * The zone B. + */ + @JsonProperty(value = "zoneB") + private Long zoneB; + + /** + * Get the zoneA property: The zone A. + * + * @return the zoneA value. + */ + public Long zoneA() { + return this.zoneA; + } + + /** + * Set the zoneA property: The zone A. + * + * @param zoneA the zoneA value to set. + * @return the SapAvailabilityZonePair object itself. + */ + public SapAvailabilityZonePair withZoneA(Long zoneA) { + this.zoneA = zoneA; + return this; + } + + /** + * Get the zoneB property: The zone B. + * + * @return the zoneB value. + */ + public Long zoneB() { + return this.zoneB; + } + + /** + * Set the zoneB property: The zone B. + * + * @param zoneB the zoneB value to set. + * @return the SapAvailabilityZonePair object itself. + */ + public SapAvailabilityZonePair withZoneB(Long zoneB) { + this.zoneB = zoneB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..57743f6f653c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstanceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Central Instances. */ +@Fluent +public final class SapCentralInstanceList { + /* + * Gets the list of SAP central instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets the list of SAP central instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP central instances. + * + * @param value the value value to set. + * @return the SapCentralInstanceList object itself. + */ + public SapCentralInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapCentralInstanceList object itself. + */ + public SapCentralInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..f0d1dcbb2f14 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralInstances.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapCentralInstances. */ +public interface SapCentralInstances { + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance. + */ + SapCentralServerInstance get(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Gets the SAP Central Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 Instance along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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 delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Instance. <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. + * @param centralInstanceName Central Instance name string modeled as parameter for auto 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); + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Central Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets the SAP Central 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Instance along with {@link Response}. + */ + SapCentralServerInstance getById(String id); + + /** + * Gets the SAP Central Instance. + * + * @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 Central Instance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the SAP Central Instance. <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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult deleteById(String id); + + /** + * Deletes the SAP Central Instance. <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. + * @throws com.azure.core.management.exception.ManagementException 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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapCentralServerInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapCentralServerInstance definition. + */ + SapCentralServerInstance.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 000000000000..dbc4d014ee62 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapCentralServerInstance.java @@ -0,0 +1,348 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapCentralServerInstanceInner; +import java.util.List; +import java.util.Map; + +/** 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 server instance id. + * + * @return the instanceNo value. + */ + String instanceNo(); + + /** + * Gets the subnet property: The central server 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(); + + /** + * Gets the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties. + * + * @return the enqueueReplicationServerProperties value. + */ + EnqueueReplicationServerProperties enqueueReplicationServerProperties(); + + /** + * Gets the kernelVersion property: The central server kernel version. + * + * @return the kernelVersion value. + */ + String kernelVersion(); + + /** + * Gets the kernelPatch property: The central server kernel patch. + * + * @return the kernelPatch value. + */ + String kernelPatch(); + + /** + * 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 SAP Instance health. + * + * @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 Central 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.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 SapCentralServerInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapCentralServerInstance definition. */ + interface Blank extends WithLocation { + } + /** 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the 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. + * @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 { + /** + * 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. */ + 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. */ + 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. */ + 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. */ + 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. + */ + interface WithEnqueueReplicationServerProperties { + /** + * Specifies the enqueueReplicationServerProperties property: Defines the SAP ERS Server properties.. + * + * @param enqueueReplicationServerProperties Defines the SAP ERS Server properties. + * @return the next definition stage. + */ + WithCreate withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties); + } + } + /** + * Begins update for the SapCentralServerInstance resource. + * + * @return the stage of resource update. + */ + SapCentralServerInstance.Update 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. */ + interface UpdateStages { + /** 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. + */ + SapCentralServerInstance refresh(Context context); +} 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 new file mode 100644 index 000000000000..377f61b709dd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfiguration.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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) +}) +@Immutable +public class SapConfiguration { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..967e9d40f0b5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapConfigurationType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapConfigurationType. */ +public final class SapConfigurationType extends ExpandableStringEnum { + /** Static value Deployment for SapConfigurationType. */ + public static final SapConfigurationType DEPLOYMENT = fromString("Deployment"); + + /** Static value Discovery for SapConfigurationType. */ + public static final SapConfigurationType DISCOVERY = fromString("Discovery"); + + /** Static value DeploymentWithOSConfig for SapConfigurationType. */ + public static final SapConfigurationType DEPLOYMENT_WITH_OSCONFIG = fromString("DeploymentWithOSConfig"); + + /** + * 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() { + return values(SapConfigurationType.class); + } +} 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 new file mode 100644 index 000000000000..5b31ddf5a56a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstance.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import java.util.List; +import java.util.Map; + +/** 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: The database subnet. + * + * @return the subnet value. + */ + String subnet(); + + /** + * Gets the databaseSid property: The database SID. + * + * @return the databaseSid value. + */ + String databaseSid(); + + /** + * Gets the databaseType property: The SAP database type. + * + * @return the databaseType value. + */ + String databaseType(); + + /** + * Gets the ipAddress property: The database IP Address. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * 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 provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + SapVirtualInstanceProvisioningState provisioningState(); + + /** + * Gets the errors property: Defines the Database 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.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 SapDatabaseInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapDatabaseInstance definition. */ + interface Blank extends WithLocation { + } + /** 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the 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. + * @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. + */ + 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. */ + 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. */ + 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. */ + interface UpdateStages { + /** 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. + */ + SapDatabaseInstance refresh(Context context); +} 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 new file mode 100644 index 000000000000..92909003994a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstanceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.SapDatabaseInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Database Instances. */ +@Fluent +public final class SapDatabaseInstanceList { + /* + * 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; + + /** + * Get the value property: Gets the list of SAP Database instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP Database instances. + * + * @param value the value value to set. + * @return the SapDatabaseInstanceList object itself. + */ + public SapDatabaseInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapDatabaseInstanceList object itself. + */ + public SapDatabaseInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..e6bddcf52c2a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseInstances.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapDatabaseInstances. */ +public interface SapDatabaseInstances { + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance. + */ + SapDatabaseInstance get(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Gets the SAP 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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 Database Instance along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the SAP Database Instance. <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. + * @param databaseInstanceName Database Instance string modeled as parameter for auto 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 databaseInstanceName, Context context); + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Database Instances in an SVI. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets the SAP 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance along with {@link Response}. + */ + SapDatabaseInstance getById(String id); + + /** + * Gets the SAP Database Instance. + * + * @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 Database Instance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the SAP Database Instance. <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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult deleteById(String id); + + /** + * Deletes the SAP Database Instance. <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. + * @throws com.azure.core.management.exception.ManagementException 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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapDatabaseInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapDatabaseInstance definition. + */ + SapDatabaseInstance.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 000000000000..e35917e2b9f0 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseScaleMethod.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapDatabaseScaleMethod. */ +public final class SapDatabaseScaleMethod extends ExpandableStringEnum { + /** Static value ScaleUp for SapDatabaseScaleMethod. */ + public static final SapDatabaseScaleMethod SCALE_UP = fromString("ScaleUp"); + + /** + * 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() { + return values(SapDatabaseScaleMethod.class); + } +} 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 new file mode 100644 index 000000000000..ef178426ffde --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDatabaseType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapDatabaseType. */ +public final class SapDatabaseType extends ExpandableStringEnum { + /** Static value HANA for SapDatabaseType. */ + public static final SapDatabaseType HANA = fromString("HANA"); + + /** Static value DB2 for SapDatabaseType. */ + public static final SapDatabaseType DB2 = fromString("DB2"); + + /** + * 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() { + return values(SapDatabaseType.class); + } +} 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 new file mode 100644 index 000000000000..d9810c7f263a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDeploymentType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapDeploymentType. */ +public final class SapDeploymentType extends ExpandableStringEnum { + /** Static value SingleServer for SapDeploymentType. */ + public static final SapDeploymentType SINGLE_SERVER = fromString("SingleServer"); + + /** Static value ThreeTier for SapDeploymentType. */ + public static final SapDeploymentType THREE_TIER = fromString("ThreeTier"); + + /** + * 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() { + return values(SapDeploymentType.class); + } +} 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 new file mode 100644 index 000000000000..12a58fcd2126 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfiguration.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP Disk Configuration. */ +@Fluent +public final class SapDiskConfiguration { + /* + * The volume name. + */ + @JsonProperty(value = "volume") + private String volume; + + /* + * The disk type. + */ + @JsonProperty(value = "diskType") + private String diskType; + + /* + * The disk count. + */ + @JsonProperty(value = "diskCount") + private Long diskCount; + + /* + * The disk size in GB. + */ + @JsonProperty(value = "diskSizeGB") + private Long diskSizeGB; + + /* + * The disk Iops. + */ + @JsonProperty(value = "diskIopsReadWrite") + private Long diskIopsReadWrite; + + /* + * The disk provisioned throughput in MBps. + */ + @JsonProperty(value = "diskMBpsReadWrite") + private Long diskMBpsReadWrite; + + /* + * The disk storage type + */ + @JsonProperty(value = "diskStorageType") + private String diskStorageType; + + /** + * Get the volume property: The volume name. + * + * @return the volume value. + */ + public String volume() { + return this.volume; + } + + /** + * Set the volume property: The volume name. + * + * @param volume the volume value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withVolume(String volume) { + this.volume = volume; + return this; + } + + /** + * Get the diskType property: The disk type. + * + * @return the diskType value. + */ + public String diskType() { + return this.diskType; + } + + /** + * Set the diskType property: The disk type. + * + * @param diskType the diskType value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskType(String diskType) { + this.diskType = diskType; + return this; + } + + /** + * Get the diskCount property: The disk count. + * + * @return the diskCount value. + */ + public Long diskCount() { + return this.diskCount; + } + + /** + * Set the diskCount property: The disk count. + * + * @param diskCount the diskCount value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskCount(Long diskCount) { + this.diskCount = diskCount; + return this; + } + + /** + * Get the diskSizeGB property: The disk size in GB. + * + * @return the diskSizeGB value. + */ + public Long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: The disk size in GB. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskSizeGB(Long diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the diskIopsReadWrite property: The disk Iops. + * + * @return the diskIopsReadWrite value. + */ + public Long diskIopsReadWrite() { + return this.diskIopsReadWrite; + } + + /** + * Set the diskIopsReadWrite property: The disk Iops. + * + * @param diskIopsReadWrite the diskIopsReadWrite value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskIopsReadWrite(Long diskIopsReadWrite) { + this.diskIopsReadWrite = diskIopsReadWrite; + return this; + } + + /** + * Get the diskMBpsReadWrite property: The disk provisioned throughput in MBps. + * + * @return the diskMBpsReadWrite value. + */ + public Long diskMBpsReadWrite() { + return this.diskMBpsReadWrite; + } + + /** + * Set the diskMBpsReadWrite property: The disk provisioned throughput in MBps. + * + * @param diskMBpsReadWrite the diskMBpsReadWrite value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskMBpsReadWrite(Long diskMBpsReadWrite) { + this.diskMBpsReadWrite = diskMBpsReadWrite; + return this; + } + + /** + * Get the diskStorageType property: The disk storage type. + * + * @return the diskStorageType value. + */ + public String diskStorageType() { + return this.diskStorageType; + } + + /** + * Set the diskStorageType property: The disk storage type. + * + * @param diskStorageType the diskStorageType value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withDiskStorageType(String diskStorageType) { + this.diskStorageType = diskStorageType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..9a52cc38e0c1 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsRequest.java @@ -0,0 +1,215 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of disk configurations. */ +@Fluent +public final class SapDiskConfigurationsRequest { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the SAP resources will be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public SapDiskConfigurationsRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the dbVmSku property: The VM SKU for database instance. + * + * @return the dbVmSku value. + */ + public String dbVmSku() { + return this.dbVmSku; + } + + /** + * Set the dbVmSku property: The VM SKU for database instance. + * + * @param dbVmSku the dbVmSku value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDbVmSku(String dbVmSku) { + this.dbVmSku = dbVmSku; + return this; + } + + /** + * 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")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapDiskConfigurationsRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapDiskConfigurationsRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapDiskConfigurationsRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapDiskConfigurationsRequest")); + } + if (dbVmSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dbVmSku in model SapDiskConfigurationsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapDiskConfigurationsRequest.class); +} 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 new file mode 100644 index 000000000000..ea36058393fd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapDiskConfigurationsResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.resourcemanager.workloads.fluent.models.SapDiskConfigurationsResultInner; +import java.util.List; + +/** An immutable client-side representation of SapDiskConfigurationsResult. */ +public interface SapDiskConfigurationsResult { + /** + * Gets the diskConfigurations property: Gets the list of Disk Configurations. + * + * @return the diskConfigurations value. + */ + List diskConfigurations(); + + /** + * 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 new file mode 100644 index 000000000000..713ad14d6756 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapEnvironmentType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapEnvironmentType. */ +public final class SapEnvironmentType extends ExpandableStringEnum { + /** Static value NonProd for SapEnvironmentType. */ + public static final SapEnvironmentType NON_PROD = fromString("NonProd"); + + /** Static value Prod for SapEnvironmentType. */ + public static final SapEnvironmentType PROD = fromString("Prod"); + + /** + * 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() { + return values(SapEnvironmentType.class); + } +} 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 new file mode 100644 index 000000000000..dc12eae270c6 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHealthState.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapHealthState. */ +public final class SapHealthState extends ExpandableStringEnum { + /** Static value Unknown for SapHealthState. */ + public static final SapHealthState UNKNOWN = fromString("Unknown"); + + /** Static value Healthy for SapHealthState. */ + public static final SapHealthState HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for SapHealthState. */ + public static final SapHealthState UNHEALTHY = fromString("Unhealthy"); + + /** Static value Degraded for SapHealthState. */ + public static final SapHealthState DEGRADED = fromString("Degraded"); + + /** + * 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() { + return values(SapHealthState.class); + } +} 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 new file mode 100644 index 000000000000..da4c7760d7c8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapHighAvailabilityType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapHighAvailabilityType. */ +public final class SapHighAvailabilityType extends ExpandableStringEnum { + /** Static value AvailabilitySet for SapHighAvailabilityType. */ + public static final SapHighAvailabilityType AVAILABILITY_SET = fromString("AvailabilitySet"); + + /** Static value AvailabilityZone for SapHighAvailabilityType. */ + public static final SapHighAvailabilityType AVAILABILITY_ZONE = fromString("AvailabilityZone"); + + /** + * 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() { + return values(SapHighAvailabilityType.class); + } +} 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 new file mode 100644 index 000000000000..a17b9d99cb7c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapInstallWithoutOSConfigSoftwareConfiguration.java @@ -0,0 +1,157 @@ +// 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.models; + +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") +@Fluent +public final class SapInstallWithoutOSConfigSoftwareConfiguration extends SoftwareConfiguration { + /* + * 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; + + /** + * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @return the bomUrl value. + */ + public String bomUrl() { + return this.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. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withBomUrl(String bomUrl) { + this.bomUrl = bomUrl; + return this; + } + + /** + * Get the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @return the sapBitsStorageAccountId value. + */ + public String sapBitsStorageAccountId() { + return this.sapBitsStorageAccountId; + } + + /** + * Set the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withSapBitsStorageAccountId(String sapBitsStorageAccountId) { + this.sapBitsStorageAccountId = sapBitsStorageAccountId; + return this; + } + + /** + * Get the softwareVersion property: The software version to install. + * + * @return the softwareVersion value. + */ + public String softwareVersion() { + return this.softwareVersion; + } + + /** + * Set the softwareVersion property: The software version to install. + * + * @param softwareVersion the softwareVersion value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @return the highAvailabilitySoftwareConfiguration value. + */ + public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { + return this.highAvailabilitySoftwareConfiguration; + } + + /** + * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withHighAvailabilitySoftwareConfiguration( + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) { + this.highAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + return this; + } + + /** + * 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")); + } + if (sapBitsStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model" + + " SapInstallWithoutOSConfigSoftwareConfiguration")); + } + if (softwareVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property softwareVersion in model" + + " SapInstallWithoutOSConfigSoftwareConfiguration")); + } + if (highAvailabilitySoftwareConfiguration() != null) { + highAvailabilitySoftwareConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapInstallWithoutOSConfigSoftwareConfiguration.class); +} 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 new file mode 100644 index 000000000000..bffb68a16de2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapProductType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapProductType. */ +public final class SapProductType extends ExpandableStringEnum { + /** Static value ECC for SapProductType. */ + public static final SapProductType ECC = fromString("ECC"); + + /** Static value S4HANA for SapProductType. */ + public static final SapProductType S4HANA = fromString("S4HANA"); + + /** Static value Other for SapProductType. */ + public static final SapProductType OTHER = fromString("Other"); + + /** + * 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() { + return values(SapProductType.class); + } +} 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 new file mode 100644 index 000000000000..0398398a97c4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationRequest.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP Sizing Recommendation request. */ +@Fluent +public final class SapSizingRecommendationRequest { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the resource is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public SapSizingRecommendationRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the saps property: The SAP Application Performance Standard measurement. + * + * @return the saps value. + */ + public long saps() { + return this.saps; + } + + /** + * Set the saps property: The SAP Application Performance Standard measurement. + * + * @param saps the saps value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withSaps(long saps) { + this.saps = saps; + return this; + } + + /** + * Get the dbMemory property: The database memory configuration. + * + * @return the dbMemory value. + */ + public long dbMemory() { + return this.dbMemory; + } + + /** + * Set the dbMemory property: The database memory configuration. + * + * @param dbMemory the dbMemory value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDbMemory(long dbMemory) { + this.dbMemory = dbMemory; + return this; + } + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the dbScaleMethod property: The DB scale method. + * + * @return the dbScaleMethod value. + */ + public SapDatabaseScaleMethod dbScaleMethod() { + return this.dbScaleMethod; + } + + /** + * Set the dbScaleMethod property: The DB scale method. + * + * @param dbScaleMethod the dbScaleMethod value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDbScaleMethod(SapDatabaseScaleMethod dbScaleMethod) { + this.dbScaleMethod = dbScaleMethod; + return this; + } + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * 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")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapSizingRecommendationRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapSizingRecommendationRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapSizingRecommendationRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapSizingRecommendationRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapSizingRecommendationRequest.class); +} 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 new file mode 100644 index 000000000000..0d54838594a2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSizingRecommendationResult.java @@ -0,0 +1,17 @@ +// 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.models; + +import com.azure.resourcemanager.workloads.fluent.models.SapSizingRecommendationResultInner; + +/** An immutable client-side representation of SapSizingRecommendationResult. */ +public interface SapSizingRecommendationResult { + /** + * 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 new file mode 100644 index 000000000000..c33b4dbe521d --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSoftwareInstallationType.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapSoftwareInstallationType. */ +public final class SapSoftwareInstallationType extends ExpandableStringEnum { + /** 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"); + + /** + * 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() { + return values(SapSoftwareInstallationType.class); + } +} 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 new file mode 100644 index 000000000000..dc12a106b2c3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedResourceSkusResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.resourcemanager.workloads.fluent.models.SapSupportedResourceSkusResultInner; +import java.util.List; + +/** 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 new file mode 100644 index 000000000000..17d16c32a4bc --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSku.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP supported SKU. */ +@Fluent +public final class SapSupportedSku { + /* + * 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; + + /** + * Get the vmSku property: The VM Sku. + * + * @return the vmSku value. + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set the vmSku property: The VM Sku. + * + * @param vmSku the vmSku value to set. + * @return the SapSupportedSku object itself. + */ + public SapSupportedSku withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + + /** + * Get the isAppServerCertified property: True if the Sku is certified for App server in the SAP system. + * + * @return the isAppServerCertified value. + */ + public Boolean isAppServerCertified() { + return this.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. + */ + public SapSupportedSku withIsAppServerCertified(Boolean isAppServerCertified) { + this.isAppServerCertified = isAppServerCertified; + return this; + } + + /** + * Get the isDatabaseCertified property: True if the Sku is certified for Database server in the SAP system. + * + * @return the isDatabaseCertified value. + */ + public Boolean isDatabaseCertified() { + return this.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. + */ + public SapSupportedSku withIsDatabaseCertified(Boolean isDatabaseCertified) { + this.isDatabaseCertified = isDatabaseCertified; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..c6c7937b7c4f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapSupportedSkusRequest.java @@ -0,0 +1,209 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of supported SKUs. */ +@Fluent +public final class SapSupportedSkusRequest { + /* + * 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; + + /** + * Get the appLocation property: The geo-location where the resource is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.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. + */ + public SapSupportedSkusRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * 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")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapSupportedSkusRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapSupportedSkusRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapSupportedSkusRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapSupportedSkusRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapSupportedSkusRequest.class); +} 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 new file mode 100644 index 000000000000..487003c60fea --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstance.java @@ -0,0 +1,398 @@ +// 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.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +import java.util.Map; + +/** 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(); + + /** + * Gets the identity property: 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 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(); + + /** + * Gets the configuration property: Defines if an existing SAP system is being registered or a new SAP system is + * being created. + * + * @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 SAP Instance health. + * + * @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: Defines the Virtual Instance for SAP 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.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 SapVirtualInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapVirtualInstance definition. */ + interface Blank extends WithLocation { + } + /** 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. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the 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. */ + 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. */ + 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. */ + interface WithConfiguration { + /** + * Specifies the configuration property: Defines if an existing SAP system is being registered or a new SAP + * system is being created. + * + * @param configuration Defines if an existing SAP system is being registered or a new SAP system is being + * created. + * @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 { + /** + * 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. */ + 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. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (user assigned identities). + * + * @param identity Managed service identity (user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(UserAssignedServiceIdentity identity); + } + /** 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. */ + 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. */ + interface UpdateStages { + /** 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. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (user assigned identities). + * + * @param identity 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. + */ + SapVirtualInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapVirtualInstance refresh(Context context); + + /** + * Starts 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. + */ + OperationStatusResult start(); + + /** + * Starts 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(Context context); + + /** + * Stops the SAP System. + * + * @param body The Virtual Instances for SAP stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(StopRequest body); + + /** + * Stops 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. + */ + OperationStatusResult stop(); + + /** + * Stops the SAP System. + * + * @param body The Virtual Instances for SAP stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(StopRequest body, Context context); +} 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 new file mode 100644 index 000000000000..e0a7d68af836 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceError.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An error response from the Virtual Instance for SAP Workload service. */ +@Fluent +public final class SapVirtualInstanceError { + /* + * The Virtual Instance for SAP error body. + */ + @JsonProperty(value = "properties") + private ErrorDefinition properties; + + /** + * Get the properties property: The Virtual Instance for SAP error body. + * + * @return the properties value. + */ + public ErrorDefinition properties() { + return this.properties; + } + + /** + * Set the properties property: The Virtual Instance for SAP error body. + * + * @param properties the properties value to set. + * @return the SapVirtualInstanceError object itself. + */ + public SapVirtualInstanceError withProperties(ErrorDefinition properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 new file mode 100644 index 000000000000..1ddbe97d4bb7 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.SapVirtualInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of Virtual Instance for SAP. */ +@Fluent +public final class SapVirtualInstanceList { + /* + * Gets the list of Virtual Instances for SAP. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets the list of Virtual Instances for SAP. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of Virtual Instances for SAP. + * + * @param value the value value to set. + * @return the SapVirtualInstanceList object itself. + */ + public SapVirtualInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapVirtualInstanceList object itself. + */ + public SapVirtualInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..9840b5f5774f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceProvisioningState.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapVirtualInstanceProvisioningState. */ +public final class SapVirtualInstanceProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState CREATING = fromString("Creating"); + + /** Static value Failed for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState DELETING = fromString("Deleting"); + + /** + * 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() { + return values(SapVirtualInstanceProvisioningState.class); + } +} 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 new file mode 100644 index 000000000000..b56974929332 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapVirtualInstanceState. */ +public final class SapVirtualInstanceState extends ExpandableStringEnum { + /** 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 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 SoftwareInstallationInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_IN_PROGRESS = + fromString("SoftwareInstallationInProgress"); + + /** Static value SoftwareInstallationFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_FAILED = fromString("SoftwareInstallationFailed"); + + /** Static value DiscoveryPending for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_PENDING = fromString("DiscoveryPending"); + + /** Static value DiscoveryInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_IN_PROGRESS = fromString("DiscoveryInProgress"); + + /** Static value DiscoveryFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_FAILED = fromString("DiscoveryFailed"); + + /** Static value RegistrationComplete for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState REGISTRATION_COMPLETE = fromString("RegistrationComplete"); + + /** + * 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() { + return values(SapVirtualInstanceState.class); + } +} 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 new file mode 100644 index 000000000000..a9464a8f384d --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstanceStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SapVirtualInstanceStatus. */ +public final class SapVirtualInstanceStatus extends ExpandableStringEnum { + /** Static value Starting for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus STARTING = fromString("Starting"); + + /** Static value Running for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus RUNNING = fromString("Running"); + + /** Static value Stopping for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus STOPPING = fromString("Stopping"); + + /** Static value Offline for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus OFFLINE = fromString("Offline"); + + /** Static value PartiallyRunning for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus PARTIALLY_RUNNING = fromString("PartiallyRunning"); + + /** Static value Unavailable for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * 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() { + return values(SapVirtualInstanceStatus.class); + } +} 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 new file mode 100644 index 000000000000..0891bc5d0155 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SapVirtualInstances.java @@ -0,0 +1,225 @@ +// 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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapVirtualInstances. */ +public interface SapVirtualInstances { + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP. + */ + SapVirtualInstance getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Gets an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Virtual Instance for SAP along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deleteByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Deletes an Virtual Instance for SAP. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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, Context context); + + /** + * Gets all Virtual Instances for SAP 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 in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all Virtual Instances for SAP 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 in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all Virtual Instances for SAP in the 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 in the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Starts 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 start(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(String resourceGroupName, String sapVirtualInstanceName, StopRequest body); + + /** + * Stops 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Stops 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. + * @param body The Virtual Instances for SAP stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 stop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + + /** + * Gets an Virtual Instance for SAP. + * + * @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 an Virtual Instance for SAP along with {@link Response}. + */ + SapVirtualInstance getById(String id); + + /** + * Gets an Virtual Instance for SAP. + * + * @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 an Virtual Instance for SAP along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Virtual Instance for SAP. + * + * @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 current status of an async operation. + */ + OperationStatusResult deleteById(String id); + + /** + * Deletes an Virtual Instance for SAP. + * + * @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 current status of an async operation. + */ + OperationStatusResult deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapVirtualInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapVirtualInstance definition. + */ + SapVirtualInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchProfile.java new file mode 100644 index 000000000000..6708270354b9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchProfile.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Search profile. */ +@Fluent +public final class SearchProfile extends NodeProfile { + /* + * Search type + */ + @JsonProperty(value = "searchType", required = true) + private SearchType searchType; + + /** + * Get the searchType property: Search type. + * + * @return the searchType value. + */ + public SearchType searchType() { + return this.searchType; + } + + /** + * Set the searchType property: Search type. + * + * @param searchType the searchType value to set. + * @return the SearchProfile object itself. + */ + public SearchProfile withSearchType(SearchType searchType) { + this.searchType = searchType; + return this; + } + + /** {@inheritDoc} */ + @Override + public SearchProfile withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SearchProfile withNodeSku(String nodeSku) { + super.withNodeSku(nodeSku); + return this; + } + + /** {@inheritDoc} */ + @Override + public SearchProfile withOsImage(OsImageProfile osImage) { + super.withOsImage(osImage); + return this; + } + + /** {@inheritDoc} */ + @Override + public SearchProfile withOsDisk(DiskInfo osDisk) { + super.withOsDisk(osDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public SearchProfile withDataDisks(List dataDisks) { + super.withDataDisks(dataDisks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (searchType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property searchType in model SearchProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SearchProfile.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchType.java new file mode 100644 index 000000000000..05ec576807b6 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SearchType.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SearchType. */ +public final class SearchType extends ExpandableStringEnum { + /** Static value Elastic for SearchType. */ + public static final SearchType ELASTIC = fromString("Elastic"); + + /** + * Creates or finds a SearchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SearchType. + */ + @JsonCreator + public static SearchType fromString(String name) { + return fromString(name, SearchType.class); + } + + /** + * Gets known SearchType values. + * + * @return known SearchType values. + */ + public static Collection values() { + return values(SearchType.class); + } +} 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 new file mode 100644 index 000000000000..81294dee4f45 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ServiceInitiatedSoftwareConfiguration.java @@ -0,0 +1,220 @@ +// 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.models; + +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. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") +@JsonTypeName("ServiceInitiated") +@Fluent +public final class ServiceInitiatedSoftwareConfiguration extends SoftwareConfiguration { + /* + * 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; + + /** + * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @return the bomUrl value. + */ + public String bomUrl() { + return this.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. + */ + public ServiceInitiatedSoftwareConfiguration withBomUrl(String bomUrl) { + this.bomUrl = bomUrl; + return this; + } + + /** + * Get the softwareVersion property: The software version to install. + * + * @return the softwareVersion value. + */ + public String softwareVersion() { + return this.softwareVersion; + } + + /** + * Set the softwareVersion property: The software version to install. + * + * @param softwareVersion the softwareVersion value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Get the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @return the sapBitsStorageAccountId value. + */ + public String sapBitsStorageAccountId() { + return this.sapBitsStorageAccountId; + } + + /** + * Set the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSapBitsStorageAccountId(String sapBitsStorageAccountId) { + this.sapBitsStorageAccountId = sapBitsStorageAccountId; + return this; + } + + /** + * Get the sapFqdn property: The FQDN to set for the SAP system during install. + * + * @return the sapFqdn value. + */ + public String sapFqdn() { + return this.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. + */ + public ServiceInitiatedSoftwareConfiguration withSapFqdn(String sapFqdn) { + this.sapFqdn = sapFqdn; + return this; + } + + /** + * Get the sshPrivateKey property: The SSH private key. + * + * @return the sshPrivateKey value. + */ + public String sshPrivateKey() { + return this.sshPrivateKey; + } + + /** + * Set the sshPrivateKey property: The SSH private key. + * + * @param sshPrivateKey the sshPrivateKey value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSshPrivateKey(String sshPrivateKey) { + this.sshPrivateKey = sshPrivateKey; + return this; + } + + /** + * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @return the highAvailabilitySoftwareConfiguration value. + */ + public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { + return this.highAvailabilitySoftwareConfiguration; + } + + /** + * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withHighAvailabilitySoftwareConfiguration( + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) { + this.highAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + return this; + } + + /** + * 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")); + } + if (softwareVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property softwareVersion in model ServiceInitiatedSoftwareConfiguration")); + } + if (sapBitsStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model" + + " ServiceInitiatedSoftwareConfiguration")); + } + if (sapFqdn() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapFqdn in model ServiceInitiatedSoftwareConfiguration")); + } + if (sshPrivateKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sshPrivateKey in model ServiceInitiatedSoftwareConfiguration")); + } + if (highAvailabilitySoftwareConfiguration() != null) { + highAvailabilitySoftwareConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceInitiatedSoftwareConfiguration.class); +} 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 new file mode 100644 index 000000000000..976acd4a9c54 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerConfiguration.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +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; + +/** Gets or sets the single server configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("SingleServer") +@Fluent +public final class SingleServerConfiguration extends InfrastructureConfiguration { + /* + * 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; + + /** + * Get the networkConfiguration property: Network configuration for the server. + * + * @return the networkConfiguration value. + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: Network configuration for the server. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.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) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public SingleServerConfiguration withAppResourceGroup(String appResourceGroup) { + super.withAppResourceGroup(appResourceGroup); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkConfiguration() != null) { + networkConfiguration().validate(); + } + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model SingleServerConfiguration")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model SingleServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SingleServerConfiguration.class); +} 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 new file mode 100644 index 000000000000..029c73b08b8f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SingleServerRecommendationResult.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +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; + +/** The recommended configuration for a single server SAP system. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("SingleServer") +@Fluent +public final class SingleServerRecommendationResult extends SapSizingRecommendationResultInner { + /* + * The recommended VM SKU for single server. + */ + @JsonProperty(value = "vmSku") + private String vmSku; + + /** + * Get the vmSku property: The recommended VM SKU for single server. + * + * @return the vmSku value. + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set the vmSku property: The recommended VM SKU for single server. + * + * @param vmSku the vmSku value to set. + * @return the SingleServerRecommendationResult object itself. + */ + public SingleServerRecommendationResult withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SiteProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SiteProfile.java new file mode 100644 index 000000000000..4a52c9a7fb39 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SiteProfile.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workload website profile. */ +@Fluent +public final class SiteProfile { + /* + * Domain name for the application site URL + */ + @JsonProperty(value = "domainName") + private String domainName; + + /** + * Get the domainName property: Domain name for the application site URL. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: Domain name for the application site URL. + * + * @param domainName the domainName value to set. + * @return the SiteProfile object itself. + */ + public SiteProfile withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Sku.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Sku.java new file mode 100644 index 000000000000..57a483f67cd2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Sku.java @@ -0,0 +1,170 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition representing SKU. */ +@Fluent +public final class Sku { + /* + * The name of the SKU. Ex - P3. It is typically a letter+number code + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /* + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCapability.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCapability.java new file mode 100644 index 000000000000..9321befb7dae --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCapability.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU capability definition. */ +@Fluent +public final class SkuCapability { + /* + * The capability name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The capability value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The capability name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The capability name. + * + * @param name the name value to set. + * @return the SkuCapability object itself. + */ + public SkuCapability withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The capability value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The capability value. + * + * @param value the value value to set. + * @return the SkuCapability object itself. + */ + public SkuCapability withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCost.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCost.java new file mode 100644 index 000000000000..96d691b4e271 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuCost.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU cost definition. */ +@Fluent +public final class SkuCost { + /* + * Billing meter id. + */ + @JsonProperty(value = "meterId") + private String meterId; + + /* + * The quantity. + */ + @JsonProperty(value = "quantity") + private Integer quantity; + + /* + * The extended unit. + */ + @JsonProperty(value = "extendedUnit") + private String extendedUnit; + + /** + * Get the meterId property: Billing meter id. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Set the meterId property: Billing meter id. + * + * @param meterId the meterId value to set. + * @return the SkuCost object itself. + */ + public SkuCost withMeterId(String meterId) { + this.meterId = meterId; + return this; + } + + /** + * Get the quantity property: The quantity. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: The quantity. + * + * @param quantity the quantity value to set. + * @return the SkuCost object itself. + */ + public SkuCost withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get the extendedUnit property: The extended unit. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Set the extendedUnit property: The extended unit. + * + * @param extendedUnit the extendedUnit value to set. + * @return the SkuCost object itself. + */ + public SkuCost withExtendedUnit(String extendedUnit) { + this.extendedUnit = extendedUnit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuDefinition.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuDefinition.java new file mode 100644 index 000000000000..5ac983b1d5d9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuDefinition.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; +import java.util.List; + +/** An immutable client-side representation of SkuDefinition. */ +public interface SkuDefinition { + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the resourceType property: Resource type the SKU applicable for. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier, but is not required on a PUT. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: If the service has different generations of hardware, for the same SKU, then that can + * be captured here. + * + * @return the family value. + */ + String family(); + + /** + * Gets the kind property: If the service has different kinds of hardware, for the same SKU, then that can be + * captured here. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the locations property: List of locations where this SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: List of locations where this SKU is available. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + Object capacity(); + + /** + * Gets the costs property: The SKU costs. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the capabilities property: The SKU capabilities. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The SKU restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner object. + * + * @return the inner object. + */ + SkuDefinitionInner innerModel(); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuLocationAndZones.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuLocationAndZones.java new file mode 100644 index 000000000000..9b2ac8bdc127 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuLocationAndZones.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SKU location and zone. */ +@Fluent +public final class SkuLocationAndZones { + /* + * The location of the SKU. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The availability zones of SKU location. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The availability zone details of the SKU location. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /* + * The extended locations of SKU. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /* + * Type of the extended location. + */ + @JsonProperty(value = "type") + private LocationType type; + + /** + * Get the location property: The location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the SKU. + * + * @param location the location value to set. + * @return the SkuLocationAndZones object itself. + */ + public SkuLocationAndZones withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The availability zones of SKU location. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The availability zones of SKU location. + * + * @param zones the zones value to set. + * @return the SkuLocationAndZones object itself. + */ + public SkuLocationAndZones withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the zoneDetails property: The availability zone details of the SKU location. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set the zoneDetails property: The availability zone details of the SKU location. + * + * @param zoneDetails the zoneDetails value to set. + * @return the SkuLocationAndZones object itself. + */ + public SkuLocationAndZones withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + + /** + * Get the extendedLocations property: The extended locations of SKU. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The extended locations of SKU. + * + * @param extendedLocations the extendedLocations value to set. + * @return the SkuLocationAndZones object itself. + */ + public SkuLocationAndZones withExtendedLocations(List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Get the type property: Type of the extended location. + * + * @return the type value. + */ + public LocationType type() { + return this.type; + } + + /** + * Set the type property: Type of the extended location. + * + * @param type the type value to set. + * @return the SkuLocationAndZones object itself. + */ + public SkuLocationAndZones withType(LocationType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestriction.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestriction.java new file mode 100644 index 000000000000..aedbbf763c2c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestriction.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SKU restriction definition. */ +@Fluent +public final class SkuRestriction { + /* + * The SKU restriction type. + */ + @JsonProperty(value = "type") + private SkuRestrictionType type; + + /* + * Restriction values. + */ + @JsonProperty(value = "values") + private List values; + + /* + * The restriction information. + */ + @JsonProperty(value = "restrictionInfo") + private Object restrictionInfo; + + /* + * The SKU restriction reason code. + */ + @JsonProperty(value = "reasonCode") + private SkuRestrictionReasonCode reasonCode; + + /** + * Get the type property: The SKU restriction type. + * + * @return the type value. + */ + public SkuRestrictionType type() { + return this.type; + } + + /** + * Set the type property: The SKU restriction type. + * + * @param type the type value to set. + * @return the SkuRestriction object itself. + */ + public SkuRestriction withType(SkuRestrictionType type) { + this.type = type; + return this; + } + + /** + * Get the values property: Restriction values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Restriction values. + * + * @param values the values value to set. + * @return the SkuRestriction object itself. + */ + public SkuRestriction withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the restrictionInfo property: The restriction information. + * + * @return the restrictionInfo value. + */ + public Object restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Set the restrictionInfo property: The restriction information. + * + * @param restrictionInfo the restrictionInfo value to set. + * @return the SkuRestriction object itself. + */ + public SkuRestriction withRestrictionInfo(Object restrictionInfo) { + this.restrictionInfo = restrictionInfo; + return this; + } + + /** + * Get the reasonCode property: The SKU restriction reason code. + * + * @return the reasonCode value. + */ + public SkuRestrictionReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: The SKU restriction reason code. + * + * @param reasonCode the reasonCode value to set. + * @return the SkuRestriction object itself. + */ + public SkuRestriction withReasonCode(SkuRestrictionReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionReasonCode.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionReasonCode.java new file mode 100644 index 000000000000..9c975d930905 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionReasonCode.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuRestrictionReasonCode. */ +public final class SkuRestrictionReasonCode extends ExpandableStringEnum { + /** Static value NotSpecified for SkuRestrictionReasonCode. */ + public static final SkuRestrictionReasonCode NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value QuotaId for SkuRestrictionReasonCode. */ + public static final SkuRestrictionReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for SkuRestrictionReasonCode. */ + public static final SkuRestrictionReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a SkuRestrictionReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuRestrictionReasonCode. + */ + @JsonCreator + public static SkuRestrictionReasonCode fromString(String name) { + return fromString(name, SkuRestrictionReasonCode.class); + } + + /** + * Gets known SkuRestrictionReasonCode values. + * + * @return known SkuRestrictionReasonCode values. + */ + public static Collection values() { + return values(SkuRestrictionReasonCode.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionType.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionType.java new file mode 100644 index 000000000000..8090c72b4914 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuRestrictionType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuRestrictionType. */ +public final class SkuRestrictionType extends ExpandableStringEnum { + /** Static value NotSpecified for SkuRestrictionType. */ + public static final SkuRestrictionType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Location for SkuRestrictionType. */ + public static final SkuRestrictionType LOCATION = fromString("Location"); + + /** Static value Zone for SkuRestrictionType. */ + public static final SkuRestrictionType ZONE = fromString("Zone"); + + /** + * Creates or finds a SkuRestrictionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuRestrictionType. + */ + @JsonCreator + public static SkuRestrictionType fromString(String name) { + return fromString(name, SkuRestrictionType.class); + } + + /** + * Gets known SkuRestrictionType values. + * + * @return known SkuRestrictionType values. + */ + public static Collection values() { + return values(SkuRestrictionType.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuTier.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuTier.java new file mode 100644 index 000000000000..8adcd71889f7 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuTier. */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuZoneDetail.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuZoneDetail.java new file mode 100644 index 000000000000..075fde9b308c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkuZoneDetail.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SKU zone details. */ +@Fluent +public final class SkuZoneDetail { + /* + * The physical zones. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * The capabilities. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get the zones property: The physical zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The physical zones. + * + * @param zones the zones value to set. + * @return the SkuZoneDetail object itself. + */ + public SkuZoneDetail withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the capabilities property: The capabilities. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The capabilities. + * + * @param capabilities the capabilities value to set. + * @return the SkuZoneDetail object itself. + */ + public SkuZoneDetail withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Skus.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Skus.java new file mode 100644 index 000000000000..3e72b5913dfd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/Skus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Lists all the available SKUs 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 SKUs supported by an Azure Resource Provider as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the available SKUs 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 SKUs 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/SkusListResult.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkusListResult.java new file mode 100644 index 000000000000..0a2025b01bb4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SkusListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloads.fluent.models.SkuDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of SKUs supported by an Azure Resource Provider. */ +@Immutable +public final class SkusListResult { + /* + * List of SKUs supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of SKU list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of SKUs supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of SKU list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..2f7052375a49 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SoftwareConfiguration.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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) +}) +@Immutable +public class SoftwareConfiguration { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..40de2ea33784 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.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. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 000000000000..1bc4ac84cb35 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshKeyPair.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH Key-pair used to authenticate with the VM. The key needs 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). + */ +@Fluent +public final class SshKeyPair { + /* + * SSH public key + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * SSH private key. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /** + * Get the publicKey property: SSH public key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: SSH public key. + * + * @param publicKey the publicKey value to set. + * @return the SshKeyPair object itself. + */ + public SshKeyPair withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the privateKey property: SSH private key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: SSH private key. + * + * @param privateKey the privateKey value to set. + * @return the SshKeyPair object itself. + */ + public SshKeyPair withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..b21e9afbe1da --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/SshPublicKey.java @@ -0,0 +1,58 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + /* + * 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; + + /** + * Get the keyData property: 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. <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() { + return this.keyData; + } + + /** + * Set the keyData property: 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. <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. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..c6235ff0185f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/StopRequest.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop SAP Request. */ +@Fluent +public final class StopRequest { + /* + * A boolean to specify if the SAP system should be hard-stopped. + */ + @JsonProperty(value = "hardStop") + private Boolean hardStop; + + /** + * Get the hardStop property: A boolean to specify if the SAP system should be hard-stopped. + * + * @return the hardStop value. + */ + public Boolean hardStop() { + return this.hardStop; + } + + /** + * Set the hardStop property: A boolean to specify if the SAP system should be hard-stopped. + * + * @param hardStop the hardStop value to set. + * @return the StopRequest object itself. + */ + public StopRequest withHardStop(Boolean hardStop) { + this.hardStop = hardStop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..4bceec468396 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierConfiguration.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +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; + +/** Gets or sets the three tier SAP configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("ThreeTier") +@Fluent +public final class ThreeTierConfiguration extends InfrastructureConfiguration { + /* + * 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; + + /** + * Get the networkConfiguration property: Network configuration common to all servers. + * + * @return the networkConfiguration value. + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: Network configuration common to all servers. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the centralServer property: The central server configuration. + * + * @return the centralServer value. + */ + public CentralServerConfiguration centralServer() { + return this.centralServer; + } + + /** + * Set the centralServer property: The central server configuration. + * + * @param centralServer the centralServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withCentralServer(CentralServerConfiguration centralServer) { + this.centralServer = centralServer; + return this; + } + + /** + * Get the applicationServer property: The application server configuration. + * + * @return the applicationServer value. + */ + public ApplicationServerConfiguration applicationServer() { + return this.applicationServer; + } + + /** + * Set the applicationServer property: The application server configuration. + * + * @param applicationServer the applicationServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withApplicationServer(ApplicationServerConfiguration applicationServer) { + this.applicationServer = applicationServer; + return this; + } + + /** + * Get the databaseServer property: The database configuration. + * + * @return the databaseServer value. + */ + public DatabaseConfiguration databaseServer() { + return this.databaseServer; + } + + /** + * Set the databaseServer property: The database configuration. + * + * @param databaseServer the databaseServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withDatabaseServer(DatabaseConfiguration databaseServer) { + this.databaseServer = databaseServer; + return this; + } + + /** + * Get the highAvailabilityConfig property: The high availability configuration. + * + * @return the highAvailabilityConfig value. + */ + public HighAvailabilityConfiguration highAvailabilityConfig() { + return this.highAvailabilityConfig; + } + + /** + * Set the highAvailabilityConfig property: The high availability configuration. + * + * @param highAvailabilityConfig the highAvailabilityConfig value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withHighAvailabilityConfig(HighAvailabilityConfiguration highAvailabilityConfig) { + this.highAvailabilityConfig = highAvailabilityConfig; + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreeTierConfiguration withAppResourceGroup(String appResourceGroup) { + super.withAppResourceGroup(appResourceGroup); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkConfiguration() != null) { + networkConfiguration().validate(); + } + if (centralServer() == null) { + throw LOGGER + .logExceptionAsError( + 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")); + } else { + applicationServer().validate(); + } + if (databaseServer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseServer in model ThreeTierConfiguration")); + } else { + databaseServer().validate(); + } + if (highAvailabilityConfig() != null) { + highAvailabilityConfig().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThreeTierConfiguration.class); +} 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 new file mode 100644 index 000000000000..3d9139473fa2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/ThreeTierRecommendationResult.java @@ -0,0 +1,183 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +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; + +/** The recommended configuration for a three tier SAP system. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("ThreeTier") +@Fluent +public final class ThreeTierRecommendationResult extends SapSizingRecommendationResultInner { + /* + * 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; + + /** + * Get the dbVmSku property: The database VM SKU. + * + * @return the dbVmSku value. + */ + public String dbVmSku() { + return this.dbVmSku; + } + + /** + * Set the dbVmSku property: The database VM SKU. + * + * @param dbVmSku the dbVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withDbVmSku(String dbVmSku) { + this.dbVmSku = dbVmSku; + return this; + } + + /** + * Get the databaseInstanceCount property: The database server instance count. + * + * @return the databaseInstanceCount value. + */ + public Long databaseInstanceCount() { + return this.databaseInstanceCount; + } + + /** + * Set the databaseInstanceCount property: The database server instance count. + * + * @param databaseInstanceCount the databaseInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withDatabaseInstanceCount(Long databaseInstanceCount) { + this.databaseInstanceCount = databaseInstanceCount; + return this; + } + + /** + * Get the centralServerVmSku property: The central server VM SKU. + * + * @return the centralServerVmSku value. + */ + public String centralServerVmSku() { + return this.centralServerVmSku; + } + + /** + * Set the centralServerVmSku property: The central server VM SKU. + * + * @param centralServerVmSku the centralServerVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withCentralServerVmSku(String centralServerVmSku) { + this.centralServerVmSku = centralServerVmSku; + return this; + } + + /** + * Get the centralServerInstanceCount property: The central server instance count. + * + * @return the centralServerInstanceCount value. + */ + public Long centralServerInstanceCount() { + return this.centralServerInstanceCount; + } + + /** + * Set the centralServerInstanceCount property: The central server instance count. + * + * @param centralServerInstanceCount the centralServerInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withCentralServerInstanceCount(Long centralServerInstanceCount) { + this.centralServerInstanceCount = centralServerInstanceCount; + return this; + } + + /** + * Get the applicationServerVmSku property: The application server VM SKU. + * + * @return the applicationServerVmSku value. + */ + public String applicationServerVmSku() { + return this.applicationServerVmSku; + } + + /** + * Set the applicationServerVmSku property: The application server VM SKU. + * + * @param applicationServerVmSku the applicationServerVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withApplicationServerVmSku(String applicationServerVmSku) { + this.applicationServerVmSku = applicationServerVmSku; + return this; + } + + /** + * Get the applicationServerInstanceCount property: The application server instance count. + * + * @return the applicationServerInstanceCount value. + */ + public Long applicationServerInstanceCount() { + return this.applicationServerInstanceCount; + } + + /** + * Set the applicationServerInstanceCount property: The application server instance count. + * + * @param applicationServerInstanceCount the applicationServerInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withApplicationServerInstanceCount(Long applicationServerInstanceCount) { + this.applicationServerInstanceCount = applicationServerInstanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 000000000000..3708cae3ef85 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapApplicationInstanceRequest.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Application Instance. */ +@Fluent +public final class UpdateSapApplicationInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapApplicationInstanceRequest object itself. + */ + public UpdateSapApplicationInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..f075844eee0c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapCentralInstanceRequest.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Central Instance. */ +@Fluent +public final class UpdateSapCentralInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapCentralInstanceRequest object itself. + */ + public UpdateSapCentralInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..4a4537a32ee0 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapDatabaseInstanceRequest.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Database Instance. */ +@Fluent +public final class UpdateSapDatabaseInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapDatabaseInstanceRequest object itself. + */ + public UpdateSapDatabaseInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..5dac60464e28 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UpdateSapVirtualInstanceRequest.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating Virtual Instance for SAP. */ +@Fluent +public final class UpdateSapVirtualInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Managed service identity (user assigned identities) + */ + @JsonProperty(value = "identity") + private UserAssignedServiceIdentity identity; + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapVirtualInstanceRequest object itself. + */ + public UpdateSapVirtualInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Managed service identity (user assigned identities). + * + * @return the identity value. + */ + public UserAssignedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (user assigned identities). + * + * @param identity the identity value to set. + * @return the UpdateSapVirtualInstanceRequest object itself. + */ + public UpdateSapVirtualInstanceRequest withIdentity(UserAssignedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} 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 new file mode 100644 index 000000000000..2f8db3c40a67 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedIdentity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * 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; + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 new file mode 100644 index 000000000000..04dc22c5a253 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserAssignedServiceIdentity.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +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 java.util.Map; + +/** Managed service identity (user assigned identities). */ +@Fluent +public class UserAssignedServiceIdentity { + /* + * 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; + + /** + * Get the type property: Type of manage identity. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of manage identity. + * + * @param type the type value to set. + * @return the UserAssignedServiceIdentity object itself. + */ + public UserAssignedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: User assigned identities dictionary. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.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) { + 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")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserAssignedServiceIdentity.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserProfile.java new file mode 100644 index 000000000000..5182edb1003f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/UserProfile.java @@ -0,0 +1,85 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User profile to configure on a compute resources such as VM, VMSS. */ +@Fluent +public final class UserProfile { + /* + * User name + */ + @JsonProperty(value = "userName", required = true) + private String username; + + /* + * SSH public key data + */ + @JsonProperty(value = "sshPublicKey", required = true) + private String sshPublicKey; + + /** + * Get the username property: User name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name. + * + * @param username the username value to set. + * @return the UserProfile object itself. + */ + public UserProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the sshPublicKey property: SSH public key data. + * + * @return the sshPublicKey value. + */ + public String sshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: SSH public key data. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the UserProfile object itself. + */ + public UserProfile withSshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property username in model UserProfile")); + } + if (sshPublicKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sshPublicKey in model UserProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserProfile.class); +} 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 new file mode 100644 index 000000000000..53a53100665b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VirtualMachineConfiguration.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the virtual machine configuration. */ +@Fluent +public final class VirtualMachineConfiguration { + /* + * 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; + + /** + * Get the vmSize property: The virtual machine size. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The virtual machine size. + * + * @param vmSize the vmSize value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the imageReference property: The image reference. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image reference. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osProfile property: The OS profile. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: The OS profile. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * 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")); + } + if (imageReference() == null) { + throw LOGGER + .logExceptionAsError( + 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")); + } else { + osProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineConfiguration.class); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VmssNodesProfile.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VmssNodesProfile.java new file mode 100644 index 000000000000..af7ef3de302c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/VmssNodesProfile.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VMSS profile. */ +@Fluent +public final class VmssNodesProfile extends NodeProfile { + /* + * Minimum number of nodes for autoscale + */ + @JsonProperty(value = "autoScaleMinCount") + private Integer autoScaleMinCount; + + /* + * Maximum number of nodes for autoscale + */ + @JsonProperty(value = "autoScaleMaxCount") + private Integer autoScaleMaxCount; + + /** + * Get the autoScaleMinCount property: Minimum number of nodes for autoscale. + * + * @return the autoScaleMinCount value. + */ + public Integer autoScaleMinCount() { + return this.autoScaleMinCount; + } + + /** + * Set the autoScaleMinCount property: Minimum number of nodes for autoscale. + * + * @param autoScaleMinCount the autoScaleMinCount value to set. + * @return the VmssNodesProfile object itself. + */ + public VmssNodesProfile withAutoScaleMinCount(Integer autoScaleMinCount) { + this.autoScaleMinCount = autoScaleMinCount; + return this; + } + + /** + * Get the autoScaleMaxCount property: Maximum number of nodes for autoscale. + * + * @return the autoScaleMaxCount value. + */ + public Integer autoScaleMaxCount() { + return this.autoScaleMaxCount; + } + + /** + * Set the autoScaleMaxCount property: Maximum number of nodes for autoscale. + * + * @param autoScaleMaxCount the autoScaleMaxCount value to set. + * @return the VmssNodesProfile object itself. + */ + public VmssNodesProfile withAutoScaleMaxCount(Integer autoScaleMaxCount) { + this.autoScaleMaxCount = autoScaleMaxCount; + return this; + } + + /** {@inheritDoc} */ + @Override + public VmssNodesProfile withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmssNodesProfile withNodeSku(String nodeSku) { + super.withNodeSku(nodeSku); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmssNodesProfile withOsImage(OsImageProfile osImage) { + super.withOsImage(osImage); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmssNodesProfile withOsDisk(DiskInfo osDisk) { + super.withOsDisk(osDisk); + return this; + } + + /** {@inheritDoc} */ + @Override + public VmssNodesProfile withDataDisks(List dataDisks) { + super.withDataDisks(dataDisks); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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 new file mode 100644 index 000000000000..8a1d046c41b5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WindowsConfiguration.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specifies Windows operating system settings on the virtual machine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "osType") +@JsonTypeName("Windows") +@Immutable +public final class WindowsConfiguration extends OSConfiguration { + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResource.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResource.java new file mode 100644 index 000000000000..0cc54dca865c --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResource.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; + +/** An immutable client-side representation of WordpressInstanceResource. */ +public interface WordpressInstanceResource { + /** + * 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 version property: Application version. + * + * @return the version value. + */ + WordpressVersions version(); + + /** + * Gets the databaseName property: Database name used by the application. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the databaseUser property: User name used by the application to connect to database. + * + * @return the databaseUser value. + */ + String databaseUser(); + + /** + * Gets the siteUrl property: Site Url to access the WordPress application. + * + * @return the siteUrl value. + */ + String siteUrl(); + + /** + * Gets the provisioningState property: WordPress instance provisioning state. + * + * @return the provisioningState value. + */ + ApplicationProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner object. + * + * @return the inner object. + */ + WordpressInstanceResourceInner innerModel(); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResourceList.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResourceList.java new file mode 100644 index 000000000000..d059f95f5e01 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstanceResourceList.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WordPress instance resource list. */ +@Fluent +public final class WordpressInstanceResourceList { + /* + * List of resources in current page + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to next page of resources + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of resources in current page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of resources in current page. + * + * @param value the value value to set. + * @return the WordpressInstanceResourceList object itself. + */ + public WordpressInstanceResourceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to next page of resources. + * + * @param nextLink the nextLink value to set. + * @return the WordpressInstanceResourceList object itself. + */ + public WordpressInstanceResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstances.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstances.java new file mode 100644 index 000000000000..d2d907f64d73 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressInstances.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; + +/** Resource collection API of WordpressInstances. */ +public interface WordpressInstances { + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String phpWorkloadName); + + /** + * Lists WordPress instance resources under a phpWorkload resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource. + */ + WordpressInstanceResource get(String resourceGroupName, String phpWorkloadName); + + /** + * Gets the WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the WordPress instance resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String phpWorkloadName, Context context); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + WordpressInstanceResource createOrUpdate( + String resourceGroupName, String phpWorkloadName, WordpressInstanceResourceInner wordpressInstanceResource); + + /** + * Create or updated WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param wordpressInstanceResource Resource create or update request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wordPress instance resource. + */ + WordpressInstanceResource createOrUpdate( + String resourceGroupName, + String phpWorkloadName, + WordpressInstanceResourceInner wordpressInstanceResource, + Context context); + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String phpWorkloadName); + + /** + * Delete WordPress instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param phpWorkloadName Php workload name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String phpWorkloadName, Context context); +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressVersions.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressVersions.java new file mode 100644 index 000000000000..661830b4d4f5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WordpressVersions.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WordpressVersions. */ +public final class WordpressVersions extends ExpandableStringEnum { + /** Static value 5.4.3 for WordpressVersions. */ + public static final WordpressVersions FIVE_FOUR_THREE = fromString("5.4.3"); + + /** Static value 5.4.2 for WordpressVersions. */ + public static final WordpressVersions FIVE_FOUR_TWO = fromString("5.4.2"); + + /** Static value 5.4.1 for WordpressVersions. */ + public static final WordpressVersions FIVE_FOUR_ONE = fromString("5.4.1"); + + /** Static value 5.4 for WordpressVersions. */ + public static final WordpressVersions FIVE_FOUR = fromString("5.4"); + + /** + * Creates or finds a WordpressVersions from its string representation. + * + * @param name a name to look for. + * @return the corresponding WordpressVersions. + */ + @JsonCreator + public static WordpressVersions fromString(String name) { + return fromString(name, WordpressVersions.class); + } + + /** + * Gets known WordpressVersions values. + * + * @return known WordpressVersions values. + */ + public static Collection values() { + return values(WordpressVersions.class); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadKind.java b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadKind.java new file mode 100644 index 000000000000..0107df87f7e5 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/main/java/com/azure/resourcemanager/workloads/models/WorkloadKind.java @@ -0,0 +1,35 @@ +// 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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadKind. */ +public final class WorkloadKind extends ExpandableStringEnum { + /** Static value WordPress for WorkloadKind. */ + public static final WorkloadKind WORD_PRESS = fromString("WordPress"); + + /** + * Creates or finds a WorkloadKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadKind. + */ + @JsonCreator + public static WorkloadKind fromString(String name) { + return fromString(name, WorkloadKind.class); + } + + /** + * Gets known WorkloadKind values. + * + * @return known WorkloadKind values. + */ + public static Collection values() { + return values(WorkloadKind.class); + } +} 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 5065ac4482d0..27bf4d9274f9 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 @@ -15,7 +15,7 @@ public final class MonitorsCreateSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_Create.json */ /** - * Sample code: Create a SAP Monitor. + * Sample code: Create a SAP monitor. * * @param manager Entry point to WorkloadsManager. */ 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 6184b59dc067..187d7f5685c4 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 @@ -12,7 +12,7 @@ public final class MonitorsListByResourceGroupSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_ListByRG.json */ /** - * Sample code: List all SAP Monitors in a resource group. + * Sample code: List all SAP monitors in a resource group. * * @param manager Entry point to WorkloadsManager. */ 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 f242da8cd498..0b93ae8b71b1 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 @@ -12,7 +12,7 @@ public final class MonitorsListSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_List.json */ /** - * Sample code: List all SAP Monitors in a subscription. + * Sample code: List all SAP monitors in a subscription. * * @param manager Entry point to WorkloadsManager. */ diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsCreateOrUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b4372c7b5741 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsCreateOrUpdateSamples.java @@ -0,0 +1,148 @@ +// 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.resourcemanager.workloads.models.AzureFrontDoorEnabled; +import com.azure.resourcemanager.workloads.models.BackupProfile; +import com.azure.resourcemanager.workloads.models.CacheProfile; +import com.azure.resourcemanager.workloads.models.DatabaseProfile; +import com.azure.resourcemanager.workloads.models.DatabaseTier; +import com.azure.resourcemanager.workloads.models.DatabaseType; +import com.azure.resourcemanager.workloads.models.DiskInfo; +import com.azure.resourcemanager.workloads.models.DiskStorageType; +import com.azure.resourcemanager.workloads.models.EnableBackup; +import com.azure.resourcemanager.workloads.models.EnableSslEnforcement; +import com.azure.resourcemanager.workloads.models.FileShareStorageType; +import com.azure.resourcemanager.workloads.models.FileShareType; +import com.azure.resourcemanager.workloads.models.FileshareProfile; +import com.azure.resourcemanager.workloads.models.HAEnabled; +import com.azure.resourcemanager.workloads.models.LoadBalancerType; +import com.azure.resourcemanager.workloads.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkProfile; +import com.azure.resourcemanager.workloads.models.NodeProfile; +import com.azure.resourcemanager.workloads.models.OSImageOffer; +import com.azure.resourcemanager.workloads.models.OSImagePublisher; +import com.azure.resourcemanager.workloads.models.OSImageSku; +import com.azure.resourcemanager.workloads.models.OSImageVersion; +import com.azure.resourcemanager.workloads.models.OsImageProfile; +import com.azure.resourcemanager.workloads.models.PhpProfile; +import com.azure.resourcemanager.workloads.models.PhpVersion; +import com.azure.resourcemanager.workloads.models.RedisCacheFamily; +import com.azure.resourcemanager.workloads.models.SearchProfile; +import com.azure.resourcemanager.workloads.models.SearchType; +import com.azure.resourcemanager.workloads.models.SiteProfile; +import com.azure.resourcemanager.workloads.models.Sku; +import com.azure.resourcemanager.workloads.models.UserProfile; +import com.azure.resourcemanager.workloads.models.VmssNodesProfile; +import com.azure.resourcemanager.workloads.models.WorkloadKind; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PhpWorkloads CreateOrUpdate. */ +public final class PhpWorkloadsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_CreateOrUpdate.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager + .phpWorkloads() + .define("wp39") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withKind(WorkloadKind.WORD_PRESS) + .withTags(mapOf()) + .withSku(new Sku().withName("Large")) + .withAppLocation("eastus") + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("php-mrg-wp39")) + .withAdminUserProfile(new UserProfile().withUsername("wpadmin").withSshPublicKey("===SSH=PUBLIC=KEY===")) + .withWebNodesProfile( + new VmssNodesProfile() + .withName("web-server") + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withAutoScaleMinCount(1) + .withAutoScaleMaxCount(1)) + .withControllerProfile( + new NodeProfile() + .withName("contoller-vm") + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withDataDisks( + Arrays.asList(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS).withSizeInGB(100L)))) + .withNetworkProfile( + new NetworkProfile() + .withLoadBalancerType(LoadBalancerType.LOAD_BALANCER) + .withLoadBalancerSku("Standard") + .withAzureFrontDoorEnabled(AzureFrontDoorEnabled.ENABLED)) + .withDatabaseProfile( + new DatabaseProfile() + .withType(DatabaseType.MY_SQL) + .withServerName("wp-db-server") + .withVersion("5.7") + .withSku("Standard_D32s_v4") + .withTier(DatabaseTier.GENERAL_PURPOSE) + .withHaEnabled(HAEnabled.DISABLED) + .withStorageSku("Premium_LRS") + .withStorageInGB(128L) + .withStorageIops(200L) + .withBackupRetentionDays(7) + .withSslEnforcementEnabled(EnableSslEnforcement.ENABLED)) + .withSiteProfile(new SiteProfile().withDomainName("www.example.com")) + .withFileshareProfile( + new FileshareProfile() + .withShareType(FileShareType.AZURE_FILES) + .withStorageType(FileShareStorageType.PREMIUM_LRS) + .withShareSizeInGB(100L)) + .withPhpProfile(new PhpProfile().withVersion(PhpVersion.SEVEN_THREE)) + .withSearchProfile( + new SearchProfile() + .withNodeSku("Standard_DS2_v2") + .withOsImage( + new OsImageProfile() + .withPublisher(OSImagePublisher.CANONICAL) + .withOffer(OSImageOffer.UBUNTU_SERVER) + .withSku(OSImageSku.fromString("18.0-LTS")) + .withVersion(OSImageVersion.LATEST)) + .withOsDisk(new DiskInfo().withStorageType(DiskStorageType.PREMIUM_LRS)) + .withSearchType(SearchType.ELASTIC)) + .withCacheProfile( + new CacheProfile() + .withName("wp-cache") + .withSkuName("Basic") + .withFamily(RedisCacheFamily.C) + .withCapacity(0L)) + .withBackupProfile(new BackupProfile().withBackupEnabled(EnableBackup.DISABLED)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsDeleteSamples.java new file mode 100644 index 000000000000..a48ae635912f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads Delete. */ +public final class PhpWorkloadsDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Delete.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().delete("test-rg", "wp39", "false", Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsGetByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0d68817c8913 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads GetByResourceGroup. */ +public final class PhpWorkloadsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Get.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().getByResourceGroupWithResponse("test-rg", "wp39", Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListByResourceGroupSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListByResourceGroupSamples.java new file mode 100644 index 000000000000..46981f1eec86 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads ListByResourceGroup. */ +public final class PhpWorkloadsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListByResourceGroup.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().listByResourceGroup("test-rg", Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListSamples.java new file mode 100644 index 000000000000..01ec31d5107a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for PhpWorkloads List. */ +public final class PhpWorkloadsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListBySubscription.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.phpWorkloads().list(Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsUpdateSamples.java new file mode 100644 index 000000000000..4fea151bd1c0 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/PhpWorkloadsUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloads.models.PatchResourceRequestBodyIdentity; +import com.azure.resourcemanager.workloads.models.PhpWorkloadResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PhpWorkloads Update. */ +public final class PhpWorkloadsUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Update.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + PhpWorkloadResource resource = + manager.phpWorkloads().getByResourceGroupWithResponse("test-rg", "wp39", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag_name", "tag_value")) + .withIdentity(new PatchResourceRequestBodyIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 ba43fb0da2f1..a9a45151a00d 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 @@ -15,82 +15,53 @@ /** Samples for ProviderInstances Create. */ public final class ProviderInstancesCreateSamples { /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create.json + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json */ /** - * Sample code: Create a SAP Monitor Hana provider. + * Sample code: Create a MsSqlServer provider. * * @param manager Entry point to WorkloadsManager. */ - public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager .providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new HanaDbProviderInstanceProperties() - .withHostname("name") - .withDbName("db") - .withSqlPort("0000") - .withInstanceNumber("00") + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") .withDbUsername("user") .withDbPassword("****") .withDbPasswordUri("") - .withDbSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") - .withSslHostnameInCertificate("xyz.domain.com")) - .create(); - } - - /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() - .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("****") - .withSapPasswordUri("") - .withSapClientId("111") - .withSapPortNumber("1234") - .withSapSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .withSapSid("sid")) .create(); } /* - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_Create.json */ /** - * Sample code: Create a MsSqlServer provider. + * Sample code: Create a SAP monitor Hana provider. * * @param manager Entry point to WorkloadsManager. */ - public static void createAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + public static void createASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) { manager .providerInstances() .define("myProviderInstance") .withExistingMonitor("myResourceGroup", "mySapMonitor") .withProviderSettings( - new MsSqlServerProviderInstanceProperties() - .withHostname("hostname") - .withDbPort("5912") + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") .withDbUsername("user") .withDbPassword("****") .withDbPasswordUri("") - .withSapSid("sid")) + .withDbSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com")) .create(); } @@ -159,4 +130,33 @@ public static void createAOSProvider(com.azure.resourcemanager.workloads.Workloa new PrometheusOSProviderInstanceProperties().withPrometheusUrl("http://192.168.0.0:9090/metrics")) .create(); } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .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("****") + .withSapPasswordUri("") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSapSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } } 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 60f640c918b2..354f1c2cc701 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 @@ -12,7 +12,7 @@ public final class ProviderInstancesListSamples { * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/ProviderInstances_List.json */ /** - * Sample code: List all SAP Monitors providers in a subscription. + * Sample code: List all SAP monitors providers in a subscription. * * @param manager Entry point to WorkloadsManager. */ 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 new file mode 100644 index 000000000000..53adb12c21ed --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java @@ -0,0 +1,35 @@ +// 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.Context; + +/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +public final class ResourceProviderSapAvailabilityZoneDetailsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, 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 new file mode 100644 index 000000000000..d9559796a7ec --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapDiskConfigurationsSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapDiskConfigurations. */ +public final class ResourceProviderSapDiskConfigurationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, 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 new file mode 100644 index 000000000000..1271c8f46f60 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSizingRecommendationsSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider SapSizingRecommendations. */ +public final class ResourceProviderSapSizingRecommendationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, 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 new file mode 100644 index 000000000000..3f685b41fec3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/ResourceProviderSapSupportedSkuSamples.java @@ -0,0 +1,60 @@ +// 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.Context; + +/** Samples for ResourceProvider SapSupportedSku. */ +public final class ResourceProviderSapSupportedSkuSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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, 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 new file mode 100644 index 000000000000..b4cddf09f19e --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesCreateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Create. */ +public final class SapApplicationServerInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("app01") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..5765e282caf3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances Delete. */ +public final class SapApplicationServerInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", 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 new file mode 100644 index 000000000000..fd8c900357bf --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances Get. */ +public final class SapApplicationServerInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "app01", 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 new file mode 100644 index 000000000000..aa31083ab91f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapApplicationServerInstances List. */ +public final class SapApplicationServerInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapApplicationServerInstances().list("test-rg", "X00", 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 new file mode 100644 index 000000000000..b2deb73db565 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapApplicationServerInstancesUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapApplicationServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Update. */ +public final class SapApplicationServerInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..18833f802ef4 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesCreateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Create. */ +public final class SapCentralInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("centralServer") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..99c0209735a3 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances Delete. */ +public final class SapCentralInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapCentralInstances().delete("test-rg", "X00", "centralServer", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..60680e3826b8 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances Get. */ +public final class SapCentralInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "centralServer", 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 new file mode 100644 index 000000000000..dbfdca738e8b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapCentralInstances List. */ +public final class SapCentralInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapCentralInstances().list("test-rg", "X00", 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 new file mode 100644 index 000000000000..f25f79c281a2 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapCentralInstancesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapCentralServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Update. */ +public final class SapCentralInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..dda92fd0e256 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesCreateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Create. */ +public final class SapDatabaseInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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() + .define("databaseServer") + .withRegion("westcentralus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..033795acad1b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances Delete. */ +public final class SapDatabaseInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapDatabaseInstances().delete("test-rg", "X00", "databaseServer", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..3b8c3d97d48f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances Get. */ +public final class SapDatabaseInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getWithResponse("test-rg", "X00", "databaseServer", 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 new file mode 100644 index 000000000000..b5e6d38c52de --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapDatabaseInstances List. */ +public final class SapDatabaseInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapDatabaseInstances().list("test-rg", "X00", 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 new file mode 100644 index 000000000000..b83af80ee25b --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapDatabaseInstancesUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.SapDatabaseInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Update. */ +public final class SapDatabaseInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource.update().withTags(mapOf("key1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..27b204fb3590 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesCreateSamples.java @@ -0,0 +1,828 @@ +// 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.resourcemanager.workloads.models.ApplicationServerConfiguration; +import com.azure.resourcemanager.workloads.models.CentralServerConfiguration; +import com.azure.resourcemanager.workloads.models.DatabaseConfiguration; +import com.azure.resourcemanager.workloads.models.DeployerVmPackages; +import com.azure.resourcemanager.workloads.models.DeploymentConfiguration; +import com.azure.resourcemanager.workloads.models.DeploymentWithOSConfiguration; +import com.azure.resourcemanager.workloads.models.HighAvailabilityConfiguration; +import com.azure.resourcemanager.workloads.models.ImageReference; +import com.azure.resourcemanager.workloads.models.LinuxConfiguration; +import com.azure.resourcemanager.workloads.models.NetworkConfiguration; +import com.azure.resourcemanager.workloads.models.OSProfile; +import com.azure.resourcemanager.workloads.models.OsSapConfiguration; +import com.azure.resourcemanager.workloads.models.SapDatabaseType; +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.SingleServerConfiguration; +import com.azure.resourcemanager.workloads.models.SshConfiguration; +import com.azure.resourcemanager.workloads.models.SshKeyPair; +import com.azure.resourcemanager.workloads.models.SshPublicKey; +import com.azure.resourcemanager.workloads.models.ThreeTierConfiguration; +import com.azure.resourcemanager.workloads.models.VirtualMachineConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Create. */ +public final class SapVirtualInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_HA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigHAAvSet( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_HA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigHAAvZone( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + */ + /** + * Sample code: SAPVirtualInstances_Create_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateDistributed( + 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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(1L)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + */ + /** + * Sample code: SAPVirtualInstances_Create_HA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateHAAvZone(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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigSingleServer( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair().withPublicKey("abc").withPrivateKey("xyz")))))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + */ + /** + * Sample code: SAPVirtualInstances_Create_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateSingleServer( + 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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData("ssh-rsa public key"))))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + */ + /** + * Sample code: SAPVirtualInstances_Create_HA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateHAAvSet(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/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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(5L)) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "ssh-rsa public key"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + */ + /** + * Sample code: SAPVirtualInstances_Create_WithOSConfig_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesCreateWithOSConfigDistributed( + com.azure.resourcemanager.workloads.WorkloadsManager manager) { + 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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .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("7.4") + .withVersion("7.4.2019062505")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("abc") + .withPrivateKey("xyz"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration( + new OsSapConfiguration() + .withDeployerVmPackages( + new DeployerVmPackages() + .withUrl( + "https://ybteststorageaccount.blob.core.windows.net/sapbits/deployervmpackages/DeployerVMPackages.zip") + .withStorageAccountId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/yb-SapInstall/providers/Microsoft.Storage/storageAccounts/ybteststorageaccount")) + .withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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 new file mode 100644 index 000000000000..09c48bea990f --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances Delete. */ +public final class SapVirtualInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().delete("test-rg", "X00", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..69b81dc63021 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances GetByResourceGroup. */ +public final class SapVirtualInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().getByResourceGroupWithResponse("test-rg", "X00", 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 new file mode 100644 index 000000000000..3465f146b28a --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances ListByResourceGroup. */ +public final class SapVirtualInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().listByResourceGroup("test-rg", 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 new file mode 100644 index 000000000000..f0f730536b35 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances List. */ +public final class SapVirtualInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().list(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 new file mode 100644 index 000000000000..ae3af9a4b808 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for SapVirtualInstances Start. */ +public final class SapVirtualInstancesStartSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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) { + manager.sapVirtualInstances().start("test-rg", "X00", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..17e635aad0b6 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.StopRequest; + +/** Samples for SapVirtualInstances Stop. */ +public final class SapVirtualInstancesStopSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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().stop("test-rg", "X00", new StopRequest().withHardStop(false), 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 new file mode 100644 index 000000000000..c93e17cc9fa9 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SapVirtualInstancesUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloads.models.SapVirtualInstance; +import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Update. */ +public final class SapVirtualInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key1", "svi1")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SkusListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SkusListSamples.java new file mode 100644 index 000000000000..f5939dab1529 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/SkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void skus(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.skus().list(Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesCreateOrUpdateSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..905a055a4059 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloads.fluent.models.WordpressInstanceResourceInner; +import com.azure.resourcemanager.workloads.models.WordpressVersions; + +/** Samples for WordpressInstances CreateOrUpdate. */ +public final class WordpressInstancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_CreateOrUpdate.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager + .wordpressInstances() + .createOrUpdate( + "test-rg", + "wp39", + new WordpressInstanceResourceInner() + .withVersion(WordpressVersions.FIVE_FOUR_TWO) + .withDatabaseName("wpdb") + .withDatabaseUser("wpuser"), + Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesDeleteSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesDeleteSamples.java new file mode 100644 index 000000000000..919b8391f2bd --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for WordpressInstances Delete. */ +public final class WordpressInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Delete.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().deleteWithResponse("test-rg", "wp39", Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesGetSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesGetSamples.java new file mode 100644 index 000000000000..e74388d52216 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for WordpressInstances Get. */ +public final class WordpressInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Get.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().getWithResponse("test-rg", "wp39", Context.NONE); + } +} diff --git a/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesListSamples.java b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesListSamples.java new file mode 100644 index 000000000000..a82bf254d169 --- /dev/null +++ b/sdk/workloads/azure-resourcemanager-workloads/src/samples/java/com/azure/resourcemanager/workloads/generated/WordpressInstancesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloads.generated; + +import com.azure.core.util.Context; + +/** Samples for WordpressInstances List. */ +public final class WordpressInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_List.json + */ + /** + * Sample code: Workloads. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void workloads(com.azure.resourcemanager.workloads.WorkloadsManager manager) { + manager.wordpressInstances().list("test-rg", "wp39", Context.NONE); + } +}