From 5548edf56409aec40985b1efa574158c862f12ec Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 4 Apr 2022 18:00:09 +0000 Subject: [PATCH] CodeGen from PR 18538 in Azure/azure-rest-api-specs Merge b87f49da04d932ff2cb3c91c5736b6cbcfb05589 into f8a711d2043b9019e2cd256ea0c6932bbf27aed7 --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 302 +++ .../azure-resourcemanager-hanaonazure/pom.xml | 98 +- .../hanaonazure/HanaManager.java | 73 +- .../fluent/HanaInstancesClient.java | 398 --- .../fluent/HanaManagementClient.java | 13 +- .../hanaonazure/fluent/OperationsClient.java | 4 +- .../fluent/ProviderInstancesClient.java | 220 ++ .../hanaonazure/fluent/SapMonitorsClient.java | 216 ++ .../fluent/models/HanaInstanceInner.java | 321 --- .../fluent/models/OperationInner.java | 4 - .../fluent/models/ProviderInstanceInner.java | 118 + .../models/ProviderInstanceProperties.java | 114 + .../fluent/models/SapMonitorInner.java | 204 ++ .../fluent/models/SapMonitorProperties.java | 206 ++ .../implementation/HanaInstanceImpl.java | 291 --- .../HanaInstancesClientImpl.java | 2193 ----------------- .../implementation/HanaInstancesImpl.java | 194 -- .../HanaManagementClientImpl.java | 38 +- .../implementation/OperationsClientImpl.java | 17 +- .../implementation/OperationsImpl.java | 3 +- .../implementation/ProviderInstanceImpl.java | 129 + .../ProviderInstancesClientImpl.java | 1169 +++++++++ .../implementation/ProviderInstancesImpl.java | 196 ++ .../implementation/SapMonitorImpl.java | 229 ++ .../implementation/SapMonitorsClientImpl.java | 1201 +++++++++ .../implementation/SapMonitorsImpl.java | 159 ++ .../hanaonazure/models/Disk.java | 94 - .../hanaonazure/models/Display.java | 4 - .../models/HanaHardwareTypeNamesEnum.java | 34 - .../hanaonazure/models/HanaInstance.java | 428 ---- .../models/HanaInstancePowerStateEnum.java | 46 - .../models/HanaInstanceSizeNamesEnum.java | 157 -- .../hanaonazure/models/HanaInstances.java | 229 -- .../hanaonazure/models/HardwareProfile.java | 76 - .../hanaonazure/models/IpAddress.java | 50 - .../hanaonazure/models/NetworkProfile.java | 80 - .../hanaonazure/models/OSProfile.java | 128 - .../hanaonazure/models/OperationList.java | 4 - .../hanaonazure/models/Operations.java | 4 +- .../hanaonazure/models/ProviderInstance.java | 156 ++ ...t.java => ProviderInstanceListResult.java} | 34 +- .../hanaonazure/models/ProviderInstances.java | 154 ++ .../hanaonazure/models/SapMonitor.java | 313 +++ .../models/SapMonitorListResult.java | 77 + .../hanaonazure/models/SapMonitors.java | 138 ++ .../hanaonazure/models/StorageProfile.java | 81 - .../hanaonazure/models/Tags.java | 14 +- .../generated/OperationsListSamples.java | 23 + .../ProviderInstancesCreateSamples.java | 28 + .../ProviderInstancesDeleteSamples.java | 22 + .../ProviderInstancesGetSamples.java | 24 + .../ProviderInstancesListSamples.java | 22 + .../generated/SapMonitorsCreateSamples.java | 48 + .../generated/SapMonitorsDeleteSamples.java | 22 + .../SapMonitorsGetByResourceGroupSamples.java | 22 + .../generated/SapMonitorsListSamples.java | 22 + .../generated/SapMonitorsUpdateSamples.java | 58 + 59 files changed, 5775 insertions(+), 4937 deletions(-) create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/SAMPLE.md delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaInstancesClient.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/HanaInstanceInner.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceProperties.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorProperties.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstanceImpl.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesClientImpl.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Disk.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaHardwareTypeNamesEnum.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstance.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancePowerStateEnum.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstanceSizeNamesEnum.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstances.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HardwareProfile.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/IpAddress.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/NetworkProfile.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OSProfile.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java rename sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/{HanaInstancesListResult.java => ProviderInstanceListResult.java} (56%) create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java delete mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/StorageProfile.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/OperationsListSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesCreateSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesDeleteSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesGetSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesListSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsCreateSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsDeleteSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsGetByResourceGroupSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsListSamples.java create mode 100644 sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsUpdateSamples.java diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md index bf979c3c6ead3..f215741ca4b34 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-04-04) +- Azure Resource Manager Hana client library for Java. This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2020-02-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-15) diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md index cdcb27a52a1c1..042da0a9afc35 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Hana client library for Java. -This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2017-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Hana Management SDK. HANA on Azure Client. Package tag package-2020-02-07-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hanaonazure - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/hanaonazure/azure-resourcemanager-hanaonazure/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/SAMPLE.md b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/SAMPLE.md new file mode 100644 index 0000000000000..2b601e5696515 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/SAMPLE.md @@ -0,0 +1,302 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## ProviderInstances + +- [Create](#providerinstances_create) +- [Delete](#providerinstances_delete) +- [Get](#providerinstances_get) +- [List](#providerinstances_list) + +## SapMonitors + +- [Create](#sapmonitors_create) +- [Delete](#sapmonitors_delete) +- [GetByResourceGroup](#sapmonitors_getbyresourcegroup) +- [List](#sapmonitors_list) +- [Update](#sapmonitors_update) +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/HanaOperations_List.json + */ + /** + * Sample code: List all HANA management operations supported by HANA RP. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllHANAManagementOperationsSupportedByHANARP( + com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### ProviderInstances_Create + +```java +/** Samples for ProviderInstances Create. */ +public final class ProviderInstancesCreateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP Monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void createASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingSapMonitor("myResourceGroup", "mySapMonitor") + .withTypePropertiesType("hana") + .withProperties( + "{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\",\"dbPassword\":\"PASSWORD\"}") + .withMetadata("{\"key\":\"value\"}") + .create(); + } +} +``` + +### ProviderInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ProviderInstances Delete. */ +public final class ProviderInstancesDeleteSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deletesASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.providerInstances().delete("myResourceGroup", "mySapMonitor", "myProviderInstance", Context.NONE); + } +} +``` + +### ProviderInstances_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProviderInstances Get. */ +public final class ProviderInstancesGetSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", Context.NONE); + } +} +``` + +### ProviderInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProviderInstances List. */ +public final class ProviderInstancesListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_List.json + */ + /** + * Sample code: List all SAP Monitors in a subscription. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.providerInstances().list("myResourceGroup", "mySapMonitor", Context.NONE); + } +} +``` + +### SapMonitors_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapMonitors Create. */ +public final class SapMonitorsCreateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Create.json + */ + /** + * Sample code: Create a SAP Monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void createASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .sapMonitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "value")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withEnableCustomerAnalytics(true) + .withLogAnalyticsWorkspaceId("00000000-0000-0000-0000-000000000000") + .withLogAnalyticsWorkspaceSharedKey( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000==") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .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; + } +} +``` + +### SapMonitors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SapMonitors Delete. */ +public final class SapMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deletesASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().delete("myResourceGroup", "mySapMonitor", Context.NONE); + } +} +``` + +### SapMonitors_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SapMonitors GetByResourceGroup. */ +public final class SapMonitorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE); + } +} +``` + +### SapMonitors_List + +```java +import com.azure.core.util.Context; + +/** Samples for SapMonitors List. */ +public final class SapMonitorsListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_List.json + */ + /** + * Sample code: List all SAP Monitors in a subscription. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().list(Context.NONE); + } +} +``` + +### SapMonitors_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapMonitors Update. */ +public final class SapMonitorsUpdateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deleteTagsFieldOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + SapMonitor resource = + manager + .sapMonitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).apply(); + } + + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_PatchTags.json + */ + /** + * Sample code: Update Tags field of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void updateTagsFieldOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + SapMonitor resource = + manager + .sapMonitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("testkey", "testvalue")).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/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml index 4434db3481857..f511b98b7e397 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-hanaonazure - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-hanaonazure + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Hana Management - This package contains Microsoft Azure SDK for Hana Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HANA on Azure Client. Package tag package-2017-11. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Hana Management + This package contains Microsoft Azure SDK for Hana Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HANA on Azure Client. Package tag package-2020-02-07-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.27.0 - - - com.azure - azure-core-management - 1.5.4 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java index 04211a9e28319..fbbf964094ea6 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/HanaManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,26 +17,32 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hanaonazure.fluent.HanaManagementClient; -import com.azure.resourcemanager.hanaonazure.implementation.HanaInstancesImpl; import com.azure.resourcemanager.hanaonazure.implementation.HanaManagementClientBuilder; import com.azure.resourcemanager.hanaonazure.implementation.OperationsImpl; -import com.azure.resourcemanager.hanaonazure.models.HanaInstances; +import com.azure.resourcemanager.hanaonazure.implementation.ProviderInstancesImpl; +import com.azure.resourcemanager.hanaonazure.implementation.SapMonitorsImpl; import com.azure.resourcemanager.hanaonazure.models.Operations; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstances; +import com.azure.resourcemanager.hanaonazure.models.SapMonitors; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to HanaManager. HANA on Azure Client. */ public final class HanaManager { private Operations operations; - private HanaInstances hanaInstances; + private SapMonitors sapMonitors; + + private ProviderInstances providerInstances; private final HanaManagementClient clientObject; @@ -76,11 +82,12 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -120,6 +127,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -138,9 +156,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -176,20 +196,33 @@ public HanaManager authenticate(TokenCredential credential, AzureProfile profile userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -209,12 +242,20 @@ public Operations operations() { return operations; } - /** @return Resource collection API of HanaInstances. */ - public HanaInstances hanaInstances() { - if (this.hanaInstances == null) { - this.hanaInstances = new HanaInstancesImpl(clientObject.getHanaInstances(), this); + /** @return Resource collection API of SapMonitors. */ + public SapMonitors sapMonitors() { + if (this.sapMonitors == null) { + this.sapMonitors = new SapMonitorsImpl(clientObject.getSapMonitors(), this); + } + return sapMonitors; + } + + /** @return Resource collection API of ProviderInstances. */ + public ProviderInstances providerInstances() { + if (this.providerInstances == null) { + this.providerInstances = new ProviderInstancesImpl(clientObject.getProviderInstances(), this); } - return hanaInstances; + return providerInstances; } /** diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaInstancesClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaInstancesClient.java deleted file mode 100644 index 1a76c1c69c8d1..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaInstancesClient.java +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.models.HanaInstanceInner; -import com.azure.resourcemanager.hanaonazure.models.Tags; - -/** An instance of this class provides access to all the operations defined in HanaInstancesClient. */ -public interface HanaInstancesClient { - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure instance. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure 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 a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HanaInstanceInner getByResourceGroup(String resourceGroupName, String hanaInstanceName); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String hanaInstanceName, Context context); - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, HanaInstanceInner> beginCreate( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter); - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, HanaInstanceInner> beginCreate( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context); - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HanaInstanceInner create( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter); - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HanaInstanceInner create( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String hanaInstanceName); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hanaInstanceName); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HanaInstanceInner update(String resourceGroupName, String hanaInstanceName, Tags tagsParameter); - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String hanaInstanceName, Tags tagsParameter, Context context); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginRestart(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginStart(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginShutdown(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginShutdown( - String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void shutdown(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void shutdown(String resourceGroupName, String hanaInstanceName, Context context); -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java index 26f52a07613a6..b21d82ddc6562 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/HanaManagementClient.java @@ -53,9 +53,16 @@ public interface HanaManagementClient { OperationsClient getOperations(); /** - * Gets the HanaInstancesClient object to access its operations. + * Gets the SapMonitorsClient object to access its operations. * - * @return the HanaInstancesClient object. + * @return the SapMonitorsClient object. */ - HanaInstancesClient getHanaInstances(); + SapMonitorsClient getSapMonitors(); + + /** + * Gets the ProviderInstancesClient object to access its operations. + * + * @return the ProviderInstancesClient object. + */ + ProviderInstancesClient getProviderInstances(); } diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java index d48e0114a9b81..b72e0dcb11227 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.java new file mode 100644 index 0000000000000..630c63244bf11 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/ProviderInstancesClient.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.hanaonazure.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.hanaonazure.fluent.models.ProviderInstanceInner; + +/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +public interface ProviderInstancesClient { + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapMonitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner get(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java new file mode 100644 index 0000000000000..6922c2f3f0bbb --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/SapMonitorsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.Tags; + +/** An instance of this class provides access to all the operations defined in SapMonitorsClient. */ +public interface SapMonitorsClient { + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner getByResourceGroup(String resourceGroupName, String sapMonitorName); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner create(String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter); + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapMonitorInner update(String resourceGroupName, String sapMonitorName, Tags tagsParameter); + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/HanaInstanceInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/HanaInstanceInner.java deleted file mode 100644 index 0c2258dfea6c6..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/HanaInstanceInner.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hanaonazure.models.HanaInstancePowerStateEnum; -import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; -import com.azure.resourcemanager.hanaonazure.models.HardwareProfile; -import com.azure.resourcemanager.hanaonazure.models.NetworkProfile; -import com.azure.resourcemanager.hanaonazure.models.OSProfile; -import com.azure.resourcemanager.hanaonazure.models.StorageProfile; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** HANA instance info on Azure (ARM properties and HANA properties). */ -@JsonFlatten -@Fluent -public class HanaInstanceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HanaInstanceInner.class); - - /* - * Specifies the hardware settings for the HANA instance. - */ - @JsonProperty(value = "properties.hardwareProfile") - private HardwareProfile hardwareProfile; - - /* - * Specifies the storage settings for the HANA instance disks. - */ - @JsonProperty(value = "properties.storageProfile") - private StorageProfile storageProfile; - - /* - * Specifies the operating system settings for the HANA instance. - */ - @JsonProperty(value = "properties.osProfile") - private OSProfile osProfile; - - /* - * Specifies the network settings for the HANA instance. - */ - @JsonProperty(value = "properties.networkProfile") - private NetworkProfile networkProfile; - - /* - * Specifies the HANA instance unique ID. - */ - @JsonProperty(value = "properties.hanaInstanceId") - private String hanaInstanceId; - - /* - * Resource power state - */ - @JsonProperty(value = "properties.powerState") - private HanaInstancePowerStateEnum powerState; - - /* - * Resource proximity placement group - */ - @JsonProperty(value = "properties.proximityPlacementGroup") - private String proximityPlacementGroup; - - /* - * Hardware revision of a HANA instance - */ - @JsonProperty(value = "properties.hwRevision") - private String hwRevision; - - /* - * ARM ID of another HanaInstance that will share a network with this - * HanaInstance - */ - @JsonProperty(value = "properties.partnerNodeId") - private String partnerNodeId; - - /* - * State of provisioning of the HanaInstance - */ - @JsonProperty(value = "properties.provisioningState") - private HanaProvisioningStatesEnum provisioningState; - - /** - * Get the hardwareProfile property: Specifies the hardware settings for the HANA instance. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Specifies the hardware settings for the HANA instance. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withHardwareProfile(HardwareProfile hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the storageProfile property: Specifies the storage settings for the HANA instance disks. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Specifies the storage settings for the HANA instance disks. - * - * @param storageProfile the storageProfile value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the osProfile property: Specifies the operating system settings for the HANA instance. - * - * @return the osProfile value. - */ - public OSProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: Specifies the operating system settings for the HANA instance. - * - * @param osProfile the osProfile value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withOsProfile(OSProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the networkProfile property: Specifies the network settings for the HANA instance. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Specifies the network settings for the HANA instance. - * - * @param networkProfile the networkProfile value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the hanaInstanceId property: Specifies the HANA instance unique ID. - * - * @return the hanaInstanceId value. - */ - public String hanaInstanceId() { - return this.hanaInstanceId; - } - - /** - * Set the hanaInstanceId property: Specifies the HANA instance unique ID. - * - * @param hanaInstanceId the hanaInstanceId value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withHanaInstanceId(String hanaInstanceId) { - this.hanaInstanceId = hanaInstanceId; - return this; - } - - /** - * Get the powerState property: Resource power state. - * - * @return the powerState value. - */ - public HanaInstancePowerStateEnum powerState() { - return this.powerState; - } - - /** - * Set the powerState property: Resource power state. - * - * @param powerState the powerState value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withPowerState(HanaInstancePowerStateEnum powerState) { - this.powerState = powerState; - return this; - } - - /** - * Get the proximityPlacementGroup property: Resource proximity placement group. - * - * @return the proximityPlacementGroup value. - */ - public String proximityPlacementGroup() { - return this.proximityPlacementGroup; - } - - /** - * Set the proximityPlacementGroup property: Resource proximity placement group. - * - * @param proximityPlacementGroup the proximityPlacementGroup value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withProximityPlacementGroup(String proximityPlacementGroup) { - this.proximityPlacementGroup = proximityPlacementGroup; - return this; - } - - /** - * Get the hwRevision property: Hardware revision of a HANA instance. - * - * @return the hwRevision value. - */ - public String hwRevision() { - return this.hwRevision; - } - - /** - * Set the hwRevision property: Hardware revision of a HANA instance. - * - * @param hwRevision the hwRevision value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withHwRevision(String hwRevision) { - this.hwRevision = hwRevision; - return this; - } - - /** - * Get the partnerNodeId property: ARM ID of another HanaInstance that will share a network with this HanaInstance. - * - * @return the partnerNodeId value. - */ - public String partnerNodeId() { - return this.partnerNodeId; - } - - /** - * Set the partnerNodeId property: ARM ID of another HanaInstance that will share a network with this HanaInstance. - * - * @param partnerNodeId the partnerNodeId value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withPartnerNodeId(String partnerNodeId) { - this.partnerNodeId = partnerNodeId; - return this; - } - - /** - * Get the provisioningState property: State of provisioning of the HanaInstance. - * - * @return the provisioningState value. - */ - public HanaProvisioningStatesEnum provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: State of provisioning of the HanaInstance. - * - * @param provisioningState the provisioningState value to set. - * @return the HanaInstanceInner object itself. - */ - public HanaInstanceInner withProvisioningState(HanaProvisioningStatesEnum provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** {@inheritDoc} */ - @Override - public HanaInstanceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public HanaInstanceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java index 90d7ab254fd9c..236c55db28cc9 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/OperationInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.hanaonazure.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hanaonazure.models.Display; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** HANA operation information. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The name of the operation being performed on this particular object. * This name should match the action name that appears in RBAC / the event diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java new file mode 100644 index 0000000000000..6408b465b665a --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A provider instance associated with a SAP monitor. */ +@Fluent +public final class ProviderInstanceInner extends ProxyResource { + /* + * Provider Instance properties + */ + @JsonProperty(value = "properties") + private ProviderInstanceProperties innerProperties; + + /** + * Get the innerProperties property: Provider Instance properties. + * + * @return the innerProperties value. + */ + private ProviderInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of provider instance. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of provider instance. + * + * @param type the type value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new ProviderInstanceProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the properties property: A JSON string containing the properties of the provider instance. + * + * @return the properties value. + */ + public String properties() { + return this.innerProperties() == null ? null : this.innerProperties().properties(); + } + + /** + * Set the properties property: A JSON string containing the properties of the provider instance. + * + * @param properties the properties value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withProperties(String properties) { + if (this.innerProperties() == null) { + this.innerProperties = new ProviderInstanceProperties(); + } + this.innerProperties().withProperties(properties); + return this; + } + + /** + * Get the metadata property: A JSON string containing metadata of the provider instance. + * + * @return the metadata value. + */ + public String metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: A JSON string containing metadata of the provider instance. + * + * @param metadata the metadata value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withMetadata(String metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new ProviderInstanceProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceProperties.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceProperties.java new file mode 100644 index 0000000000000..a52c8be167b8b --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/ProviderInstanceProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a provider instance. */ +@Fluent +public final class ProviderInstanceProperties { + /* + * The type of provider instance. + */ + @JsonProperty(value = "type") + private String type; + + /* + * A JSON string containing the properties of the provider instance. + */ + @JsonProperty(value = "properties") + private String properties; + + /* + * A JSON string containing metadata of the provider instance. + */ + @JsonProperty(value = "metadata") + private String metadata; + + /* + * State of provisioning of the provider instance + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private HanaProvisioningStatesEnum provisioningState; + + /** + * Get the type property: The type of provider instance. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of provider instance. + * + * @param type the type value to set. + * @return the ProviderInstanceProperties object itself. + */ + public ProviderInstanceProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the properties property: A JSON string containing the properties of the provider instance. + * + * @return the properties value. + */ + public String properties() { + return this.properties; + } + + /** + * Set the properties property: A JSON string containing the properties of the provider instance. + * + * @param properties the properties value to set. + * @return the ProviderInstanceProperties object itself. + */ + public ProviderInstanceProperties withProperties(String properties) { + this.properties = properties; + return this; + } + + /** + * Get the metadata property: A JSON string containing metadata of the provider instance. + * + * @return the metadata value. + */ + public String metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A JSON string containing metadata of the provider instance. + * + * @param metadata the metadata value to set. + * @return the ProviderInstanceProperties object itself. + */ + public ProviderInstanceProperties withMetadata(String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java new file mode 100644 index 0000000000000..7edb2fafa0569 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorInner.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** SAP monitor info on Azure (ARM properties and SAP monitor properties). */ +@Fluent +public final class SapMonitorInner extends Resource { + /* + * SAP monitor properties + */ + @JsonProperty(value = "properties") + private SapMonitorProperties innerProperties; + + /** + * Get the innerProperties property: SAP monitor properties. + * + * @return the innerProperties value. + */ + private SapMonitorProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public SapMonitorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapMonitorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: State of provisioning of the HanaInstance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the managedResourceGroupName property: The name of the resource group the SAP Monitor resources get deployed + * into. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupName(); + } + + /** + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + public String logAnalyticsWorkspaceArmId() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceArmId(); + } + + /** + * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + if (this.innerProperties() == null) { + this.innerProperties = new SapMonitorProperties(); + } + this.innerProperties().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId); + return this; + } + + /** + * Get the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @return the enableCustomerAnalytics value. + */ + public Boolean enableCustomerAnalytics() { + return this.innerProperties() == null ? null : this.innerProperties().enableCustomerAnalytics(); + } + + /** + * Set the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @param enableCustomerAnalytics the enableCustomerAnalytics value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withEnableCustomerAnalytics(Boolean enableCustomerAnalytics) { + if (this.innerProperties() == null) { + this.innerProperties = new SapMonitorProperties(); + } + this.innerProperties().withEnableCustomerAnalytics(enableCustomerAnalytics); + return this; + } + + /** + * Get the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @return the logAnalyticsWorkspaceId value. + */ + public String logAnalyticsWorkspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceId(); + } + + /** + * Set the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @param logAnalyticsWorkspaceId the logAnalyticsWorkspaceId value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId) { + if (this.innerProperties() == null) { + this.innerProperties = new SapMonitorProperties(); + } + this.innerProperties().withLogAnalyticsWorkspaceId(logAnalyticsWorkspaceId); + return this; + } + + /** + * Get the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceSharedKey value. + */ + public String logAnalyticsWorkspaceSharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceSharedKey(); + } + + /** + * Set the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceSharedKey the logAnalyticsWorkspaceSharedKey value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey) { + if (this.innerProperties() == null) { + this.innerProperties = new SapMonitorProperties(); + } + this.innerProperties().withLogAnalyticsWorkspaceSharedKey(logAnalyticsWorkspaceSharedKey); + return this; + } + + /** + * Get the sapMonitorCollectorVersion property: The version of the payload running in the Collector VM. + * + * @return the sapMonitorCollectorVersion value. + */ + public String sapMonitorCollectorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().sapMonitorCollectorVersion(); + } + + /** + * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + public String monitorSubnet() { + return this.innerProperties() == null ? null : this.innerProperties().monitorSubnet(); + } + + /** + * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet the monitorSubnet value to set. + * @return the SapMonitorInner object itself. + */ + public SapMonitorInner withMonitorSubnet(String monitorSubnet) { + if (this.innerProperties() == null) { + this.innerProperties = new SapMonitorProperties(); + } + this.innerProperties().withMonitorSubnet(monitorSubnet); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorProperties.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorProperties.java new file mode 100644 index 0000000000000..44ed25a8b1303 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/fluent/models/SapMonitorProperties.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a SAP monitor. */ +@Fluent +public final class SapMonitorProperties { + /* + * State of provisioning of the HanaInstance + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private HanaProvisioningStatesEnum provisioningState; + + /* + * The name of the resource group the SAP Monitor resources get deployed + * into. + */ + @JsonProperty(value = "managedResourceGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String managedResourceGroupName; + + /* + * The ARM ID of the Log Analytics Workspace that is used for monitoring + */ + @JsonProperty(value = "logAnalyticsWorkspaceArmId") + private String logAnalyticsWorkspaceArmId; + + /* + * The value indicating whether to send analytics to Microsoft + */ + @JsonProperty(value = "enableCustomerAnalytics") + private Boolean enableCustomerAnalytics; + + /* + * The workspace ID of the log analytics workspace to be used for + * monitoring + */ + @JsonProperty(value = "logAnalyticsWorkspaceId") + private String logAnalyticsWorkspaceId; + + /* + * The shared key of the log analytics workspace that is used for + * monitoring + */ + @JsonProperty(value = "logAnalyticsWorkspaceSharedKey") + private String logAnalyticsWorkspaceSharedKey; + + /* + * The version of the payload running in the Collector VM + */ + @JsonProperty(value = "sapMonitorCollectorVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sapMonitorCollectorVersion; + + /* + * The subnet which the SAP monitor will be deployed in + */ + @JsonProperty(value = "monitorSubnet") + private String monitorSubnet; + + /** + * Get the provisioningState property: State of provisioning of the HanaInstance. + * + * @return the provisioningState value. + */ + public HanaProvisioningStatesEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the managedResourceGroupName property: The name of the resource group the SAP Monitor resources get deployed + * into. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.managedResourceGroupName; + } + + /** + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + public String logAnalyticsWorkspaceArmId() { + return this.logAnalyticsWorkspaceArmId; + } + + /** + * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. + * @return the SapMonitorProperties object itself. + */ + public SapMonitorProperties withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.logAnalyticsWorkspaceArmId = logAnalyticsWorkspaceArmId; + return this; + } + + /** + * Get the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @return the enableCustomerAnalytics value. + */ + public Boolean enableCustomerAnalytics() { + return this.enableCustomerAnalytics; + } + + /** + * Set the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @param enableCustomerAnalytics the enableCustomerAnalytics value to set. + * @return the SapMonitorProperties object itself. + */ + public SapMonitorProperties withEnableCustomerAnalytics(Boolean enableCustomerAnalytics) { + this.enableCustomerAnalytics = enableCustomerAnalytics; + return this; + } + + /** + * Get the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @return the logAnalyticsWorkspaceId value. + */ + public String logAnalyticsWorkspaceId() { + return this.logAnalyticsWorkspaceId; + } + + /** + * Set the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @param logAnalyticsWorkspaceId the logAnalyticsWorkspaceId value to set. + * @return the SapMonitorProperties object itself. + */ + public SapMonitorProperties withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId) { + this.logAnalyticsWorkspaceId = logAnalyticsWorkspaceId; + return this; + } + + /** + * Get the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceSharedKey value. + */ + public String logAnalyticsWorkspaceSharedKey() { + return this.logAnalyticsWorkspaceSharedKey; + } + + /** + * Set the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @param logAnalyticsWorkspaceSharedKey the logAnalyticsWorkspaceSharedKey value to set. + * @return the SapMonitorProperties object itself. + */ + public SapMonitorProperties withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey) { + this.logAnalyticsWorkspaceSharedKey = logAnalyticsWorkspaceSharedKey; + return this; + } + + /** + * Get the sapMonitorCollectorVersion property: The version of the payload running in the Collector VM. + * + * @return the sapMonitorCollectorVersion value. + */ + public String sapMonitorCollectorVersion() { + return this.sapMonitorCollectorVersion; + } + + /** + * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + public String monitorSubnet() { + return this.monitorSubnet; + } + + /** + * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet the monitorSubnet value to set. + * @return the SapMonitorProperties object itself. + */ + public SapMonitorProperties withMonitorSubnet(String monitorSubnet) { + this.monitorSubnet = monitorSubnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstanceImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstanceImpl.java deleted file mode 100644 index 4a8705359fc3c..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstanceImpl.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.implementation; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner; -import com.azure.resourcemanager.hanaonazure.models.HanaInstance; -import com.azure.resourcemanager.hanaonazure.models.HanaInstancePowerStateEnum; -import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; -import com.azure.resourcemanager.hanaonazure.models.HardwareProfile; -import com.azure.resourcemanager.hanaonazure.models.NetworkProfile; -import com.azure.resourcemanager.hanaonazure.models.OSProfile; -import com.azure.resourcemanager.hanaonazure.models.StorageProfile; -import com.azure.resourcemanager.hanaonazure.models.Tags; -import java.util.Collections; -import java.util.Map; - -public final class HanaInstanceImpl implements HanaInstance, HanaInstance.Definition, HanaInstance.Update { - private HanaInstanceInner innerObject; - - private final com.azure.resourcemanager.hanaonazure.HanaManager 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 HardwareProfile hardwareProfile() { - return this.innerModel().hardwareProfile(); - } - - public StorageProfile storageProfile() { - return this.innerModel().storageProfile(); - } - - public OSProfile osProfile() { - return this.innerModel().osProfile(); - } - - public NetworkProfile networkProfile() { - return this.innerModel().networkProfile(); - } - - public String hanaInstanceId() { - return this.innerModel().hanaInstanceId(); - } - - public HanaInstancePowerStateEnum powerState() { - return this.innerModel().powerState(); - } - - public String proximityPlacementGroup() { - return this.innerModel().proximityPlacementGroup(); - } - - public String hwRevision() { - return this.innerModel().hwRevision(); - } - - public String partnerNodeId() { - return this.innerModel().partnerNodeId(); - } - - public HanaProvisioningStatesEnum provisioningState() { - return this.innerModel().provisioningState(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public HanaInstanceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.hanaonazure.HanaManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String hanaInstanceName; - - private Tags updateTagsParameter; - - public HanaInstanceImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public HanaInstance create() { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .create(resourceGroupName, hanaInstanceName, this.innerModel(), Context.NONE); - return this; - } - - public HanaInstance create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .create(resourceGroupName, hanaInstanceName, this.innerModel(), context); - return this; - } - - HanaInstanceImpl(String name, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { - this.innerObject = new HanaInstanceInner(); - this.serviceManager = serviceManager; - this.hanaInstanceName = name; - } - - public HanaInstanceImpl update() { - this.updateTagsParameter = new Tags(); - return this; - } - - public HanaInstance apply() { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .updateWithResponse(resourceGroupName, hanaInstanceName, updateTagsParameter, Context.NONE) - .getValue(); - return this; - } - - public HanaInstance apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .updateWithResponse(resourceGroupName, hanaInstanceName, updateTagsParameter, context) - .getValue(); - return this; - } - - HanaInstanceImpl(HanaInstanceInner innerObject, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.hanaInstanceName = Utils.getValueFromIdByName(innerObject.id(), "hanaInstances"); - } - - public HanaInstance refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .getByResourceGroupWithResponse(resourceGroupName, hanaInstanceName, Context.NONE) - .getValue(); - return this; - } - - public HanaInstance refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHanaInstances() - .getByResourceGroupWithResponse(resourceGroupName, hanaInstanceName, context) - .getValue(); - return this; - } - - public void restart() { - serviceManager.hanaInstances().restart(resourceGroupName, hanaInstanceName); - } - - public void restart(Context context) { - serviceManager.hanaInstances().restart(resourceGroupName, hanaInstanceName, context); - } - - public void start() { - serviceManager.hanaInstances().start(resourceGroupName, hanaInstanceName); - } - - public void start(Context context) { - serviceManager.hanaInstances().start(resourceGroupName, hanaInstanceName, context); - } - - public void shutdown() { - serviceManager.hanaInstances().shutdown(resourceGroupName, hanaInstanceName); - } - - public void shutdown(Context context) { - serviceManager.hanaInstances().shutdown(resourceGroupName, hanaInstanceName, context); - } - - public HanaInstanceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public HanaInstanceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public HanaInstanceImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateTagsParameter.withTags(tags); - return this; - } - } - - public HanaInstanceImpl withHardwareProfile(HardwareProfile hardwareProfile) { - this.innerModel().withHardwareProfile(hardwareProfile); - return this; - } - - public HanaInstanceImpl withStorageProfile(StorageProfile storageProfile) { - this.innerModel().withStorageProfile(storageProfile); - return this; - } - - public HanaInstanceImpl withOsProfile(OSProfile osProfile) { - this.innerModel().withOsProfile(osProfile); - return this; - } - - public HanaInstanceImpl withNetworkProfile(NetworkProfile networkProfile) { - this.innerModel().withNetworkProfile(networkProfile); - return this; - } - - public HanaInstanceImpl withHanaInstanceId(String hanaInstanceId) { - this.innerModel().withHanaInstanceId(hanaInstanceId); - return this; - } - - public HanaInstanceImpl withPowerState(HanaInstancePowerStateEnum powerState) { - this.innerModel().withPowerState(powerState); - return this; - } - - public HanaInstanceImpl withProximityPlacementGroup(String proximityPlacementGroup) { - this.innerModel().withProximityPlacementGroup(proximityPlacementGroup); - return this; - } - - public HanaInstanceImpl withHwRevision(String hwRevision) { - this.innerModel().withHwRevision(hwRevision); - return this; - } - - public HanaInstanceImpl withPartnerNodeId(String partnerNodeId) { - this.innerModel().withPartnerNodeId(partnerNodeId); - return this; - } - - public HanaInstanceImpl withProvisioningState(HanaProvisioningStatesEnum provisioningState) { - this.innerModel().withProvisioningState(provisioningState); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesClientImpl.java deleted file mode 100644 index c59a01efaca01..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesClientImpl.java +++ /dev/null @@ -1,2193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.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.logging.ClientLogger; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.hanaonazure.fluent.HanaInstancesClient; -import com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner; -import com.azure.resourcemanager.hanaonazure.models.HanaInstancesListResult; -import com.azure.resourcemanager.hanaonazure.models.Tags; -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 HanaInstancesClient. */ -public final class HanaInstancesClientImpl implements HanaInstancesClient { - private final ClientLogger logger = new ClientLogger(HanaInstancesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final HanaInstancesService service; - - /** The service client containing this operation class. */ - private final HanaManagementClientImpl client; - - /** - * Initializes an instance of HanaInstancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HanaInstancesClientImpl(HanaManagementClientImpl client) { - this.service = - RestProxy.create(HanaInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for HanaManagementClientHanaInstances to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "HanaManagementClient") - private interface HanaInstancesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances") - @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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @BodyParam("application/json") HanaInstanceInner hanaInstanceParameter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @BodyParam("application/json") Tags tagsParameter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" - + "/hanaInstances/{hanaInstanceName}/shutdown") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> shutdown( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hanaInstanceName") String hanaInstanceName, - @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); - - @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); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure instance. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription. - */ - @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())); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure 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 a list of SAP HANA instances in the specified subscription. - */ - @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)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure instance. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure 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 a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure instance. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure 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 a list of SAP HANA instances in the specified subscription. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @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.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @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.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hanaInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hanaInstanceName, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context); - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String hanaInstanceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hanaInstanceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HanaInstanceInner getByResourceGroup(String resourceGroupName, String hanaInstanceName) { - return getByResourceGroupAsync(resourceGroupName, hanaInstanceName).block(); - } - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hanaInstanceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, hanaInstanceName, context).block(); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - if (hanaInstanceParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceParameter is required and cannot be null.")); - } else { - hanaInstanceParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - hanaInstanceParameter, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - if (hanaInstanceParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceParameter is required and cannot be null.")); - } else { - hanaInstanceParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - hanaInstanceParameter, - accept, - context); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, HanaInstanceInner> beginCreateAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), HanaInstanceInner.class, HanaInstanceInner.class, Context.NONE); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, HanaInstanceInner> beginCreateAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), HanaInstanceInner.class, HanaInstanceInner.class, context); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, HanaInstanceInner> beginCreate( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter) { - return beginCreateAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter).getSyncPoller(); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, HanaInstanceInner> beginCreate( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context) { - return beginCreateAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter, context).getSyncPoller(); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter) { - return beginCreateAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context) { - return beginCreateAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HanaInstanceInner create( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter) { - return createAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter).block(); - } - - /** - * Creates a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param hanaInstanceParameter Request body representing a HanaInstance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HanaInstanceInner create( - String resourceGroupName, String hanaInstanceName, HanaInstanceInner hanaInstanceParameter, Context context) { - return createAsync(resourceGroupName, hanaInstanceName, hanaInstanceParameter, context).block(); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String hanaInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String hanaInstanceName, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String hanaInstanceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, hanaInstanceName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String hanaInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, hanaInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String hanaInstanceName) { - return beginDeleteAsync(resourceGroupName, hanaInstanceName).getSyncPoller(); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String hanaInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, hanaInstanceName, context).getSyncPoller(); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String hanaInstanceName) { - return beginDeleteAsync(resourceGroupName, hanaInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String hanaInstanceName, Context context) { - return beginDeleteAsync(resourceGroupName, hanaInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hanaInstanceName) { - deleteAsync(resourceGroupName, hanaInstanceName).block(); - } - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String hanaInstanceName, Context context) { - deleteAsync(resourceGroupName, hanaInstanceName, context).block(); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String hanaInstanceName, Tags tagsParameter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - if (tagsParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); - } else { - tagsParameter.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - tagsParameter, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String hanaInstanceName, Tags tagsParameter, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - if (tagsParameter == null) { - return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); - } else { - tagsParameter.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - tagsParameter, - accept, - context); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String hanaInstanceName, Tags tagsParameter) { - return updateWithResponseAsync(resourceGroupName, hanaInstanceName, tagsParameter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HanaInstanceInner update(String resourceGroupName, String hanaInstanceName, Tags tagsParameter) { - return updateAsync(resourceGroupName, hanaInstanceName, tagsParameter).block(); - } - - /** - * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure instance. - * @param tagsParameter Request body that only contains the new Tags field. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hANA instance info on Azure (ARM properties and HANA properties). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String hanaInstanceName, Tags tagsParameter, Context context) { - return updateWithResponseAsync(resourceGroupName, hanaInstanceName, tagsParameter, context).block(); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String hanaInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String hanaInstanceName, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String hanaInstanceName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, hanaInstanceName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String hanaInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = restartWithResponseAsync(resourceGroupName, hanaInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart(String resourceGroupName, String hanaInstanceName) { - return beginRestartAsync(resourceGroupName, hanaInstanceName).getSyncPoller(); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String hanaInstanceName, Context context) { - return beginRestartAsync(resourceGroupName, hanaInstanceName, context).getSyncPoller(); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String hanaInstanceName) { - return beginRestartAsync(resourceGroupName, hanaInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String hanaInstanceName, Context context) { - return beginRestartAsync(resourceGroupName, hanaInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String hanaInstanceName) { - restartAsync(resourceGroupName, hanaInstanceName).block(); - } - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String hanaInstanceName, Context context) { - restartAsync(resourceGroupName, hanaInstanceName, context).block(); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String hanaInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String hanaInstanceName, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String hanaInstanceName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, hanaInstanceName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String hanaInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, hanaInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart(String resourceGroupName, String hanaInstanceName) { - return beginStartAsync(resourceGroupName, hanaInstanceName).getSyncPoller(); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginStart( - String resourceGroupName, String hanaInstanceName, Context context) { - return beginStartAsync(resourceGroupName, hanaInstanceName, context).getSyncPoller(); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String hanaInstanceName) { - return beginStartAsync(resourceGroupName, hanaInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String hanaInstanceName, Context context) { - return beginStartAsync(resourceGroupName, hanaInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String hanaInstanceName) { - startAsync(resourceGroupName, hanaInstanceName).block(); - } - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String hanaInstanceName, Context context) { - startAsync(resourceGroupName, hanaInstanceName, context).block(); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> shutdownWithResponseAsync( - String resourceGroupName, String hanaInstanceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .shutdown( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> shutdownWithResponseAsync( - String resourceGroupName, String hanaInstanceName, 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 (hanaInstanceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter hanaInstanceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .shutdown( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hanaInstanceName, - accept, - context); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginShutdownAsync(String resourceGroupName, String hanaInstanceName) { - Mono>> mono = shutdownWithResponseAsync(resourceGroupName, hanaInstanceName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginShutdownAsync( - String resourceGroupName, String hanaInstanceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = shutdownWithResponseAsync(resourceGroupName, hanaInstanceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginShutdown(String resourceGroupName, String hanaInstanceName) { - return beginShutdownAsync(resourceGroupName, hanaInstanceName).getSyncPoller(); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginShutdown( - String resourceGroupName, String hanaInstanceName, Context context) { - return beginShutdownAsync(resourceGroupName, hanaInstanceName, context).getSyncPoller(); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono shutdownAsync(String resourceGroupName, String hanaInstanceName) { - return beginShutdownAsync(resourceGroupName, hanaInstanceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono shutdownAsync(String resourceGroupName, String hanaInstanceName, Context context) { - return beginShutdownAsync(resourceGroupName, hanaInstanceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void shutdown(String resourceGroupName, String hanaInstanceName) { - shutdownAsync(resourceGroupName, hanaInstanceName).block(); - } - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void shutdown(String resourceGroupName, String hanaInstanceName, Context context) { - shutdownAsync(resourceGroupName, hanaInstanceName, 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 the response from the List HANA Instances operation. - */ - @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 the response from the List HANA Instances operation. - */ - @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)); - } - - /** - * 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 the response from the List HANA Instances operation. - */ - @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 the response from the List HANA Instances operation. - */ - @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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesImpl.java deleted file mode 100644 index 7c07e070e9d15..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaInstancesImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.HanaInstancesClient; -import com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner; -import com.azure.resourcemanager.hanaonazure.models.HanaInstance; -import com.azure.resourcemanager.hanaonazure.models.HanaInstances; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class HanaInstancesImpl implements HanaInstances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HanaInstancesImpl.class); - - private final HanaInstancesClient innerClient; - - private final com.azure.resourcemanager.hanaonazure.HanaManager serviceManager; - - public HanaInstancesImpl( - HanaInstancesClient innerClient, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new HanaInstanceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new HanaInstanceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new HanaInstanceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new HanaInstanceImpl(inner1, this.manager())); - } - - public HanaInstance getByResourceGroup(String resourceGroupName, String hanaInstanceName) { - HanaInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, hanaInstanceName); - if (inner != null) { - return new HanaInstanceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hanaInstanceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hanaInstanceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new HanaInstanceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String hanaInstanceName) { - this.serviceClient().delete(resourceGroupName, hanaInstanceName); - } - - public void delete(String resourceGroupName, String hanaInstanceName, Context context) { - this.serviceClient().delete(resourceGroupName, hanaInstanceName, context); - } - - public void restart(String resourceGroupName, String hanaInstanceName) { - this.serviceClient().restart(resourceGroupName, hanaInstanceName); - } - - public void restart(String resourceGroupName, String hanaInstanceName, Context context) { - this.serviceClient().restart(resourceGroupName, hanaInstanceName, context); - } - - public void start(String resourceGroupName, String hanaInstanceName) { - this.serviceClient().start(resourceGroupName, hanaInstanceName); - } - - public void start(String resourceGroupName, String hanaInstanceName, Context context) { - this.serviceClient().start(resourceGroupName, hanaInstanceName, context); - } - - public void shutdown(String resourceGroupName, String hanaInstanceName) { - this.serviceClient().shutdown(resourceGroupName, hanaInstanceName); - } - - public void shutdown(String resourceGroupName, String hanaInstanceName, Context context) { - this.serviceClient().shutdown(resourceGroupName, hanaInstanceName, context); - } - - public HanaInstance 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 hanaInstanceName = Utils.getValueFromIdByName(id, "hanaInstances"); - if (hanaInstanceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hanaInstances'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, hanaInstanceName, 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 hanaInstanceName = Utils.getValueFromIdByName(id, "hanaInstances"); - if (hanaInstanceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hanaInstances'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, hanaInstanceName, 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 hanaInstanceName = Utils.getValueFromIdByName(id, "hanaInstances"); - if (hanaInstanceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hanaInstances'.", id))); - } - this.delete(resourceGroupName, hanaInstanceName, Context.NONE); - } - - public void 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 hanaInstanceName = Utils.getValueFromIdByName(id, "hanaInstances"); - if (hanaInstanceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hanaInstances'.", id))); - } - this.delete(resourceGroupName, hanaInstanceName, context); - } - - private HanaInstancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.hanaonazure.HanaManager manager() { - return this.serviceManager; - } - - public HanaInstanceImpl define(String name) { - return new HanaInstanceImpl(name, this.manager()); - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java index c51117fcf238b..d2c5d765d0e17 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/HanaManagementClientImpl.java @@ -21,9 +21,10 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hanaonazure.fluent.HanaInstancesClient; import com.azure.resourcemanager.hanaonazure.fluent.HanaManagementClient; import com.azure.resourcemanager.hanaonazure.fluent.OperationsClient; +import com.azure.resourcemanager.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.SapMonitorsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -37,8 +38,6 @@ /** Initializes a new instance of the HanaManagementClientImpl type. */ @ServiceClient(builder = HanaManagementClientBuilder.class) public final class HanaManagementClientImpl implements HanaManagementClient { - private final ClientLogger logger = new ClientLogger(HanaManagementClientImpl.class); - /** * Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI * for every service call. @@ -127,16 +126,28 @@ public OperationsClient getOperations() { return this.operations; } - /** The HanaInstancesClient object to access its operations. */ - private final HanaInstancesClient hanaInstances; + /** The SapMonitorsClient object to access its operations. */ + private final SapMonitorsClient sapMonitors; + + /** + * Gets the SapMonitorsClient object to access its operations. + * + * @return the SapMonitorsClient object. + */ + public SapMonitorsClient getSapMonitors() { + return this.sapMonitors; + } + + /** The ProviderInstancesClient object to access its operations. */ + private final ProviderInstancesClient providerInstances; /** - * Gets the HanaInstancesClient object to access its operations. + * Gets the ProviderInstancesClient object to access its operations. * - * @return the HanaInstancesClient object. + * @return the ProviderInstancesClient object. */ - public HanaInstancesClient getHanaInstances() { - return this.hanaInstances; + public ProviderInstancesClient getProviderInstances() { + return this.providerInstances; } /** @@ -162,9 +173,10 @@ public HanaInstancesClient getHanaInstances() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2017-11-03-preview"; + this.apiVersion = "2020-02-07-preview"; this.operations = new OperationsClientImpl(this); - this.hanaInstances = new HanaInstancesClientImpl(this); + this.sapMonitors = new SapMonitorsClientImpl(this); + this.providerInstances = new ProviderInstancesClientImpl(this); } /** @@ -250,7 +262,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -309,4 +321,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(HanaManagementClientImpl.class); } diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java index d5b02f11b4311..f01f8026e0bcd 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hanaonazure.fluent.OperationsClient; import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; import com.azure.resourcemanager.hanaonazure.models.OperationList; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -74,7 +71,8 @@ Mono> list( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -102,7 +100,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -127,7 +126,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -141,7 +140,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -153,7 +152,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -167,7 +166,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java index 05186b05e999e..f7c095bbe0b27 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; import com.azure.resourcemanager.hanaonazure.models.Operation; import com.azure.resourcemanager.hanaonazure.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.java new file mode 100644 index 0000000000000..7f421d2021d61 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstanceImpl.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.hanaonazure.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstance; + +public final class ProviderInstanceImpl implements ProviderInstance, ProviderInstance.Definition { + private ProviderInstanceInner innerObject; + + private final com.azure.resourcemanager.hanaonazure.HanaManager serviceManager; + + ProviderInstanceImpl( + ProviderInstanceInner innerObject, com.azure.resourcemanager.hanaonazure.HanaManager 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 String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String properties() { + return this.innerModel().properties(); + } + + public String metadata() { + return this.innerModel().metadata(); + } + + public HanaProvisioningStatesEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public ProviderInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hanaonazure.HanaManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapMonitorName; + + private String providerInstanceName; + + public ProviderInstanceImpl withExistingSapMonitor(String resourceGroupName, String sapMonitorName) { + this.resourceGroupName = resourceGroupName; + this.sapMonitorName = sapMonitorName; + return this; + } + + public ProviderInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, sapMonitorName, providerInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public ProviderInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, sapMonitorName, providerInstanceName, this.innerModel(), context); + return this; + } + + ProviderInstanceImpl(String name, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { + this.innerObject = new ProviderInstanceInner(); + this.serviceManager = serviceManager; + this.providerInstanceName = name; + } + + public ProviderInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, Context.NONE) + .getValue(); + return this; + } + + public ProviderInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, context) + .getValue(); + return this; + } + + public ProviderInstanceImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public ProviderInstanceImpl withProperties(String properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ProviderInstanceImpl withMetadata(String metadata) { + this.innerModel().withMetadata(metadata); + return this; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java new file mode 100644 index 0000000000000..c07a7750fafbf --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesClientImpl.java @@ -0,0 +1,1169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstanceListResult; +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 ProviderInstancesClient. */ +public final class ProviderInstancesClientImpl implements ProviderInstancesClient { + /** The proxy service used to perform REST calls. */ + private final ProviderInstancesService service; + + /** The service client containing this operation class. */ + private final HanaManagementClientImpl client; + + /** + * Initializes an instance of ProviderInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderInstancesClientImpl(HanaManagementClientImpl client) { + this.service = + RestProxy.create(ProviderInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HanaManagementClientProviderInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HanaManagementClient") + private interface ProviderInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @BodyParam("application/json") ProviderInstanceInner providerInstanceParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @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 a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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(), + resourceGroupName, + sapMonitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName 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(), + resourceGroupName, + sapMonitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String sapMonitorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapMonitorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapMonitorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapMonitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapMonitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapMonitorName)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapMonitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapMonitorName, context)); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + accept, + context); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return getWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner get(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return getAsync(resourceGroupName, sapMonitorName, providerInstanceName).block(); + } + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, context).block(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with a SAP monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProviderInstanceInner.class, + ProviderInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, context); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter) + .getSyncPoller(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return beginCreateAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .getSyncPoller(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with a SAP monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return beginCreateAsync( + resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return createAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter).block(); + } + + /** + * Creates a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider 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 a provider instance associated with a SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String sapMonitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return createAsync(resourceGroupName, sapMonitorName, providerInstanceName, providerInstanceParameter, context) + .block(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + providerInstanceName, + accept, + context); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapMonitorName, providerInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName).getSyncPoller(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, context).getSyncPoller(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + deleteAsync(resourceGroupName, sapMonitorName, providerInstanceName).block(); + } + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + deleteAsync(resourceGroupName, sapMonitorName, providerInstanceName, 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 the response from the List provider instances operation 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 the response from the List provider instances operation 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.java new file mode 100644 index 0000000000000..18302729272f4 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/ProviderInstancesImpl.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.hanaonazure.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.hanaonazure.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstance; +import com.azure.resourcemanager.hanaonazure.models.ProviderInstances; + +public final class ProviderInstancesImpl implements ProviderInstances { + private static final ClientLogger LOGGER = new ClientLogger(ProviderInstancesImpl.class); + + private final ProviderInstancesClient innerClient; + + private final com.azure.resourcemanager.hanaonazure.HanaManager serviceManager; + + public ProviderInstancesImpl( + ProviderInstancesClient innerClient, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String sapMonitorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, sapMonitorName); + return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String sapMonitorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapMonitorName, context); + return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public ProviderInstance get(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + ProviderInstanceInner inner = this.serviceClient().get(resourceGroupName, sapMonitorName, providerInstanceName); + if (inner != null) { + return new ProviderInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, providerInstanceName); + } + + public void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, providerInstanceName, context); + } + + public ProviderInstance 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapMonitorName, providerInstanceName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, providerInstanceName, Context.NONE); + } + + public void 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, providerInstanceName, context); + } + + private ProviderInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hanaonazure.HanaManager manager() { + return this.serviceManager; + } + + public ProviderInstanceImpl define(String name) { + return new ProviderInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java new file mode 100644 index 0000000000000..eaf546df3f4af --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.HanaProvisioningStatesEnum; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import com.azure.resourcemanager.hanaonazure.models.Tags; +import java.util.Collections; +import java.util.Map; + +public final class SapMonitorImpl implements SapMonitor, SapMonitor.Definition, SapMonitor.Update { + private SapMonitorInner innerObject; + + private final com.azure.resourcemanager.hanaonazure.HanaManager 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 HanaProvisioningStatesEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public String managedResourceGroupName() { + return this.innerModel().managedResourceGroupName(); + } + + public String logAnalyticsWorkspaceArmId() { + return this.innerModel().logAnalyticsWorkspaceArmId(); + } + + public Boolean enableCustomerAnalytics() { + return this.innerModel().enableCustomerAnalytics(); + } + + public String logAnalyticsWorkspaceId() { + return this.innerModel().logAnalyticsWorkspaceId(); + } + + public String logAnalyticsWorkspaceSharedKey() { + return this.innerModel().logAnalyticsWorkspaceSharedKey(); + } + + public String sapMonitorCollectorVersion() { + return this.innerModel().sapMonitorCollectorVersion(); + } + + public String monitorSubnet() { + return this.innerModel().monitorSubnet(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SapMonitorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hanaonazure.HanaManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapMonitorName; + + private Tags updateTagsParameter; + + public SapMonitorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SapMonitor create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .create(resourceGroupName, sapMonitorName, this.innerModel(), Context.NONE); + return this; + } + + public SapMonitor create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .create(resourceGroupName, sapMonitorName, this.innerModel(), context); + return this; + } + + SapMonitorImpl(String name, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { + this.innerObject = new SapMonitorInner(); + this.serviceManager = serviceManager; + this.sapMonitorName = name; + } + + public SapMonitorImpl update() { + this.updateTagsParameter = new Tags(); + return this; + } + + public SapMonitor apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .updateWithResponse(resourceGroupName, sapMonitorName, updateTagsParameter, Context.NONE) + .getValue(); + return this; + } + + public SapMonitor apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .updateWithResponse(resourceGroupName, sapMonitorName, updateTagsParameter, context) + .getValue(); + return this; + } + + SapMonitorImpl(SapMonitorInner innerObject, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapMonitorName = Utils.getValueFromIdByName(innerObject.id(), "sapMonitors"); + } + + public SapMonitor refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, Context.NONE) + .getValue(); + return this; + } + + public SapMonitor refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapMonitors() + .getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, context) + .getValue(); + return this; + } + + public SapMonitorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapMonitorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapMonitorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTagsParameter.withTags(tags); + return this; + } + } + + public SapMonitorImpl withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.innerModel().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId); + return this; + } + + public SapMonitorImpl withEnableCustomerAnalytics(Boolean enableCustomerAnalytics) { + this.innerModel().withEnableCustomerAnalytics(enableCustomerAnalytics); + return this; + } + + public SapMonitorImpl withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId) { + this.innerModel().withLogAnalyticsWorkspaceId(logAnalyticsWorkspaceId); + return this; + } + + public SapMonitorImpl withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey) { + this.innerModel().withLogAnalyticsWorkspaceSharedKey(logAnalyticsWorkspaceSharedKey); + return this; + } + + public SapMonitorImpl withMonitorSubnet(String monitorSubnet) { + this.innerModel().withMonitorSubnet(monitorSubnet); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java new file mode 100644 index 0000000000000..8c176c7e036c8 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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.hanaonazure.fluent.SapMonitorsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.SapMonitorListResult; +import com.azure.resourcemanager.hanaonazure.models.Tags; +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 SapMonitorsClient. */ +public final class SapMonitorsClientImpl implements SapMonitorsClient { + /** The proxy service used to perform REST calls. */ + private final SapMonitorsService service; + + /** The service client containing this operation class. */ + private final HanaManagementClientImpl client; + + /** + * Initializes an instance of SapMonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapMonitorsClientImpl(HanaManagementClientImpl client) { + this.service = + RestProxy.create(SapMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HanaManagementClientSapMonitors to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HanaManagementClient") + private interface SapMonitorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/sapMonitors") + @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( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @BodyParam("application/json") SapMonitorInner sapMonitorParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure" + + "/sapMonitors/{sapMonitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapMonitorName") String sapMonitorName, + @BodyParam("application/json") Tags tagsParameter, + @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 a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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())); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + accept, + context); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sapMonitorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapMonitorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner getByResourceGroup(String resourceGroupName, String sapMonitorName) { + return getByResourceGroupAsync(resourceGroupName, sapMonitorName).block(); + } + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapMonitorName, context).block(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (sapMonitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter sapMonitorParameter is required and cannot be null.")); + } else { + sapMonitorParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + sapMonitorParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (sapMonitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter sapMonitorParameter is required and cannot be null.")); + } else { + sapMonitorParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + sapMonitorParameter, + accept, + context); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapMonitorInner> beginCreateAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, sapMonitorParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapMonitorInner.class, + SapMonitorInner.class, + this.client.getContext()); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapMonitorInner> beginCreateAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SapMonitorInner.class, SapMonitorInner.class, context); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter).getSyncPoller(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapMonitorInner> beginCreate( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context).getSyncPoller(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return beginCreateAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter Request body representing a SAP Monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter) { + return createAsync(resourceGroupName, sapMonitorName, sapMonitorParameter).block(); + } + + /** + * Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param sapMonitorParameter 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner create( + String resourceGroupName, String sapMonitorName, SapMonitorInner sapMonitorParameter, Context context) { + return createAsync(resourceGroupName, sapMonitorName, sapMonitorParameter, context).block(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sapMonitorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapMonitorName, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + accept, + context); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sapMonitorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapMonitorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapMonitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapMonitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sapMonitorName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName).getSyncPoller(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, context).getSyncPoller(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName) { + return beginDeleteAsync(resourceGroupName, sapMonitorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapMonitorName, Context context) { + return beginDeleteAsync(resourceGroupName, sapMonitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName) { + deleteAsync(resourceGroupName, sapMonitorName).block(); + } + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapMonitorName, Context context) { + deleteAsync(resourceGroupName, sapMonitorName, context).block(); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + tagsParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, 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 (sapMonitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter sapMonitorName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + sapMonitorName, + tagsParameter, + accept, + context); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + return updateWithResponseAsync(resourceGroupName, sapMonitorName, tagsParameter) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapMonitorInner update(String resourceGroupName, String sapMonitorName, Tags tagsParameter) { + return updateAsync(resourceGroupName, sapMonitorName, tagsParameter).block(); + } + + /** + * Patches the Tags field of a SAP monitor for the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param tagsParameter Request body that only contains the new Tags field. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String sapMonitorName, Tags tagsParameter, Context context) { + return updateWithResponseAsync(resourceGroupName, sapMonitorName, tagsParameter, 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 the response from the List SAP monitors operation 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 the response from the List SAP monitors operation 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.java new file mode 100644 index 0000000000000..d9548d581171f --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/implementation/SapMonitorsImpl.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.hanaonazure.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.hanaonazure.fluent.SapMonitorsClient; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import com.azure.resourcemanager.hanaonazure.models.SapMonitors; + +public final class SapMonitorsImpl implements SapMonitors { + private static final ClientLogger LOGGER = new ClientLogger(SapMonitorsImpl.class); + + private final SapMonitorsClient innerClient; + + private final com.azure.resourcemanager.hanaonazure.HanaManager serviceManager; + + public SapMonitorsImpl( + SapMonitorsClient innerClient, com.azure.resourcemanager.hanaonazure.HanaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SapMonitorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SapMonitorImpl(inner1, this.manager())); + } + + public SapMonitor getByResourceGroup(String resourceGroupName, String sapMonitorName) { + SapMonitorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sapMonitorName); + if (inner != null) { + return new SapMonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapMonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sapMonitorName) { + this.serviceClient().delete(resourceGroupName, sapMonitorName); + } + + public void delete(String resourceGroupName, String sapMonitorName, Context context) { + this.serviceClient().delete(resourceGroupName, sapMonitorName, context); + } + + public SapMonitor 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapMonitorName, 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, Context.NONE); + } + + public void 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 sapMonitorName = Utils.getValueFromIdByName(id, "sapMonitors"); + if (sapMonitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sapMonitors'.", id))); + } + this.delete(resourceGroupName, sapMonitorName, context); + } + + private SapMonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hanaonazure.HanaManager manager() { + return this.serviceManager; + } + + public SapMonitorImpl define(String name) { + return new SapMonitorImpl(name, this.manager()); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Disk.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Disk.java deleted file mode 100644 index 10b3563c5446c..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Disk.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the disk information fo the HANA instance. */ -@Fluent -public final class Disk { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Disk.class); - - /* - * The disk name. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Specifies the size of an empty data disk in gigabytes. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * Specifies the logical unit number of the data disk. This value is used - * to identify data disks within the VM and therefore must be unique for - * each data disk attached to a VM. - */ - @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) - private Integer lun; - - /** - * Get the name property: The disk name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The disk name. - * - * @param name the name value to set. - * @return the Disk object itself. - */ - public Disk withName(String name) { - this.name = name; - return this; - } - - /** - * Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the Disk object itself. - */ - public Disk withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the lun property: Specifies the logical unit number of the data disk. This value is used to identify data - * disks within the VM and therefore must be unique for each data disk attached to a VM. - * - * @return the lun value. - */ - public Integer lun() { - return this.lun; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java index 3de8f83a0694b..18210a8219d8a 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Display.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.hanaonazure.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Detailed HANA operation information. */ @Immutable public final class Display { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Display.class); - /* * The localized friendly form of the resource provider name. This form is * also expected to include the publisher/company responsible. Use Title diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaHardwareTypeNamesEnum.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaHardwareTypeNamesEnum.java deleted file mode 100644 index 483aaff8c2332..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaHardwareTypeNamesEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HanaHardwareTypeNamesEnum. */ -public final class HanaHardwareTypeNamesEnum extends ExpandableStringEnum { - /** Static value Cisco_UCS for HanaHardwareTypeNamesEnum. */ - public static final HanaHardwareTypeNamesEnum CISCO_UCS = fromString("Cisco_UCS"); - - /** Static value HPE for HanaHardwareTypeNamesEnum. */ - public static final HanaHardwareTypeNamesEnum HPE = fromString("HPE"); - - /** - * Creates or finds a HanaHardwareTypeNamesEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding HanaHardwareTypeNamesEnum. - */ - @JsonCreator - public static HanaHardwareTypeNamesEnum fromString(String name) { - return fromString(name, HanaHardwareTypeNamesEnum.class); - } - - /** @return known HanaHardwareTypeNamesEnum values. */ - public static Collection values() { - return values(HanaHardwareTypeNamesEnum.class); - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstance.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstance.java deleted file mode 100644 index b93f129c4446f..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstance.java +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner; -import java.util.Map; - -/** An immutable client-side representation of HanaInstance. */ -public interface HanaInstance { - /** - * 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 hardwareProfile property: Specifies the hardware settings for the HANA instance. - * - * @return the hardwareProfile value. - */ - HardwareProfile hardwareProfile(); - - /** - * Gets the storageProfile property: Specifies the storage settings for the HANA instance disks. - * - * @return the storageProfile value. - */ - StorageProfile storageProfile(); - - /** - * Gets the osProfile property: Specifies the operating system settings for the HANA instance. - * - * @return the osProfile value. - */ - OSProfile osProfile(); - - /** - * Gets the networkProfile property: Specifies the network settings for the HANA instance. - * - * @return the networkProfile value. - */ - NetworkProfile networkProfile(); - - /** - * Gets the hanaInstanceId property: Specifies the HANA instance unique ID. - * - * @return the hanaInstanceId value. - */ - String hanaInstanceId(); - - /** - * Gets the powerState property: Resource power state. - * - * @return the powerState value. - */ - HanaInstancePowerStateEnum powerState(); - - /** - * Gets the proximityPlacementGroup property: Resource proximity placement group. - * - * @return the proximityPlacementGroup value. - */ - String proximityPlacementGroup(); - - /** - * Gets the hwRevision property: Hardware revision of a HANA instance. - * - * @return the hwRevision value. - */ - String hwRevision(); - - /** - * Gets the partnerNodeId property: ARM ID of another HanaInstance that will share a network with this HanaInstance. - * - * @return the partnerNodeId value. - */ - String partnerNodeId(); - - /** - * Gets the provisioningState property: State of provisioning of the HanaInstance. - * - * @return the provisioningState value. - */ - HanaProvisioningStatesEnum 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 inner com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner object. - * - * @return the inner object. - */ - HanaInstanceInner innerModel(); - - /** The entirety of the HanaInstance definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The HanaInstance definition stages. */ - interface DefinitionStages { - /** The first stage of the HanaInstance definition. */ - interface Blank extends WithLocation { - } - /** The stage of the HanaInstance 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 HanaInstance definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName Name of the resource group. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the HanaInstance 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.WithHardwareProfile, - DefinitionStages.WithStorageProfile, - DefinitionStages.WithOsProfile, - DefinitionStages.WithNetworkProfile, - DefinitionStages.WithHanaInstanceId, - DefinitionStages.WithPowerState, - DefinitionStages.WithProximityPlacementGroup, - DefinitionStages.WithHwRevision, - DefinitionStages.WithPartnerNodeId, - DefinitionStages.WithProvisioningState { - /** - * Executes the create request. - * - * @return the created resource. - */ - HanaInstance create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - HanaInstance create(Context context); - } - /** The stage of the HanaInstance 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 HanaInstance definition allowing to specify hardwareProfile. */ - interface WithHardwareProfile { - /** - * Specifies the hardwareProfile property: Specifies the hardware settings for the HANA instance.. - * - * @param hardwareProfile Specifies the hardware settings for the HANA instance. - * @return the next definition stage. - */ - WithCreate withHardwareProfile(HardwareProfile hardwareProfile); - } - /** The stage of the HanaInstance definition allowing to specify storageProfile. */ - interface WithStorageProfile { - /** - * Specifies the storageProfile property: Specifies the storage settings for the HANA instance disks.. - * - * @param storageProfile Specifies the storage settings for the HANA instance disks. - * @return the next definition stage. - */ - WithCreate withStorageProfile(StorageProfile storageProfile); - } - /** The stage of the HanaInstance definition allowing to specify osProfile. */ - interface WithOsProfile { - /** - * Specifies the osProfile property: Specifies the operating system settings for the HANA instance.. - * - * @param osProfile Specifies the operating system settings for the HANA instance. - * @return the next definition stage. - */ - WithCreate withOsProfile(OSProfile osProfile); - } - /** The stage of the HanaInstance definition allowing to specify networkProfile. */ - interface WithNetworkProfile { - /** - * Specifies the networkProfile property: Specifies the network settings for the HANA instance.. - * - * @param networkProfile Specifies the network settings for the HANA instance. - * @return the next definition stage. - */ - WithCreate withNetworkProfile(NetworkProfile networkProfile); - } - /** The stage of the HanaInstance definition allowing to specify hanaInstanceId. */ - interface WithHanaInstanceId { - /** - * Specifies the hanaInstanceId property: Specifies the HANA instance unique ID.. - * - * @param hanaInstanceId Specifies the HANA instance unique ID. - * @return the next definition stage. - */ - WithCreate withHanaInstanceId(String hanaInstanceId); - } - /** The stage of the HanaInstance definition allowing to specify powerState. */ - interface WithPowerState { - /** - * Specifies the powerState property: Resource power state. - * - * @param powerState Resource power state. - * @return the next definition stage. - */ - WithCreate withPowerState(HanaInstancePowerStateEnum powerState); - } - /** The stage of the HanaInstance definition allowing to specify proximityPlacementGroup. */ - interface WithProximityPlacementGroup { - /** - * Specifies the proximityPlacementGroup property: Resource proximity placement group. - * - * @param proximityPlacementGroup Resource proximity placement group. - * @return the next definition stage. - */ - WithCreate withProximityPlacementGroup(String proximityPlacementGroup); - } - /** The stage of the HanaInstance definition allowing to specify hwRevision. */ - interface WithHwRevision { - /** - * Specifies the hwRevision property: Hardware revision of a HANA instance. - * - * @param hwRevision Hardware revision of a HANA instance. - * @return the next definition stage. - */ - WithCreate withHwRevision(String hwRevision); - } - /** The stage of the HanaInstance definition allowing to specify partnerNodeId. */ - interface WithPartnerNodeId { - /** - * Specifies the partnerNodeId property: ARM ID of another HanaInstance that will share a network with this - * HanaInstance. - * - * @param partnerNodeId ARM ID of another HanaInstance that will share a network with this HanaInstance. - * @return the next definition stage. - */ - WithCreate withPartnerNodeId(String partnerNodeId); - } - /** The stage of the HanaInstance definition allowing to specify provisioningState. */ - interface WithProvisioningState { - /** - * Specifies the provisioningState property: State of provisioning of the HanaInstance. - * - * @param provisioningState State of provisioning of the HanaInstance. - * @return the next definition stage. - */ - WithCreate withProvisioningState(HanaProvisioningStatesEnum provisioningState); - } - } - /** - * Begins update for the HanaInstance resource. - * - * @return the stage of resource update. - */ - HanaInstance.Update update(); - - /** The template for HanaInstance update. */ - interface Update extends UpdateStages.WithTags { - /** - * Executes the update request. - * - * @return the updated resource. - */ - HanaInstance apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - HanaInstance apply(Context context); - } - /** The HanaInstance update stages. */ - interface UpdateStages { - /** The stage of the HanaInstance update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Tags field of the HANA instance.. - * - * @param tags Tags field of the HANA instance. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - HanaInstance refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - HanaInstance refresh(Context context); - - /** - * The operation to restart a SAP HANA instance. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(); - - /** - * The operation to restart a SAP HANA 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. - */ - void restart(Context context); - - /** - * The operation to start a SAP HANA instance. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(); - - /** - * The operation to start a SAP HANA 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. - */ - void start(Context context); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void shutdown(); - - /** - * The operation to shutdown a SAP HANA 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. - */ - void shutdown(Context context); -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancePowerStateEnum.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancePowerStateEnum.java deleted file mode 100644 index 7d9b849d622d3..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancePowerStateEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HanaInstancePowerStateEnum. */ -public final class HanaInstancePowerStateEnum extends ExpandableStringEnum { - /** Static value starting for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum STARTING = fromString("starting"); - - /** Static value started for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum STARTED = fromString("started"); - - /** Static value stopping for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum STOPPING = fromString("stopping"); - - /** Static value stopped for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum STOPPED = fromString("stopped"); - - /** Static value restarting for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum RESTARTING = fromString("restarting"); - - /** Static value unknown for HanaInstancePowerStateEnum. */ - public static final HanaInstancePowerStateEnum UNKNOWN = fromString("unknown"); - - /** - * Creates or finds a HanaInstancePowerStateEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding HanaInstancePowerStateEnum. - */ - @JsonCreator - public static HanaInstancePowerStateEnum fromString(String name) { - return fromString(name, HanaInstancePowerStateEnum.class); - } - - /** @return known HanaInstancePowerStateEnum values. */ - public static Collection values() { - return values(HanaInstancePowerStateEnum.class); - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstanceSizeNamesEnum.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstanceSizeNamesEnum.java deleted file mode 100644 index de070dfd14271..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstanceSizeNamesEnum.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for HanaInstanceSizeNamesEnum. */ -public final class HanaInstanceSizeNamesEnum extends ExpandableStringEnum { - /** Static value S72m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S72M = fromString("S72m"); - - /** Static value S144m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S144M = fromString("S144m"); - - /** Static value S72 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S72 = fromString("S72"); - - /** Static value S144 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S144 = fromString("S144"); - - /** Static value S192 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S192 = fromString("S192"); - - /** Static value S192m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S192M = fromString("S192m"); - - /** Static value S192xm for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S192XM = fromString("S192xm"); - - /** Static value S96 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S96 = fromString("S96"); - - /** Static value S112 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S112 = fromString("S112"); - - /** Static value S224 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224 = fromString("S224"); - - /** Static value S224m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224M = fromString("S224m"); - - /** Static value S224om for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224OM = fromString("S224om"); - - /** Static value S224oo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224OO = fromString("S224oo"); - - /** Static value S224oom for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224OOM = fromString("S224oom"); - - /** Static value S224ooo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S224OOO = fromString("S224ooo"); - - /** Static value S384 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S384 = fromString("S384"); - - /** Static value S384m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S384M = fromString("S384m"); - - /** Static value S384xm for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S384XM = fromString("S384xm"); - - /** Static value S384xxm for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S384XXM = fromString("S384xxm"); - - /** Static value S448 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448 = fromString("S448"); - - /** Static value S448m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448M = fromString("S448m"); - - /** Static value S448om for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448OM = fromString("S448om"); - - /** Static value S448oo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448OO = fromString("S448oo"); - - /** Static value S448oom for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448OOM = fromString("S448oom"); - - /** Static value S448ooo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S448OOO = fromString("S448ooo"); - - /** Static value S576m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S576M = fromString("S576m"); - - /** Static value S576xm for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S576XM = fromString("S576xm"); - - /** Static value S672 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672 = fromString("S672"); - - /** Static value S672m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672M = fromString("S672m"); - - /** Static value S672om for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672OM = fromString("S672om"); - - /** Static value S672oo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672OO = fromString("S672oo"); - - /** Static value S672oom for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672OOM = fromString("S672oom"); - - /** Static value S672ooo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S672OOO = fromString("S672ooo"); - - /** Static value S768 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S768 = fromString("S768"); - - /** Static value S768m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S768M = fromString("S768m"); - - /** Static value S768xm for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S768XM = fromString("S768xm"); - - /** Static value S896 for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896 = fromString("S896"); - - /** Static value S896m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896M = fromString("S896m"); - - /** Static value S896om for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896OM = fromString("S896om"); - - /** Static value S896oo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896OO = fromString("S896oo"); - - /** Static value S896oom for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896OOM = fromString("S896oom"); - - /** Static value S896ooo for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S896OOO = fromString("S896ooo"); - - /** Static value S960m for HanaInstanceSizeNamesEnum. */ - public static final HanaInstanceSizeNamesEnum S960M = fromString("S960m"); - - /** - * Creates or finds a HanaInstanceSizeNamesEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding HanaInstanceSizeNamesEnum. - */ - @JsonCreator - public static HanaInstanceSizeNamesEnum fromString(String name) { - return fromString(name, HanaInstanceSizeNamesEnum.class); - } - - /** @return known HanaInstanceSizeNamesEnum values. */ - public static Collection values() { - return values(HanaInstanceSizeNamesEnum.class); - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstances.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstances.java deleted file mode 100644 index 49625de607920..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstances.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.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 HanaInstances. */ -public interface HanaInstances { - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure instance. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription. - */ - PagedIterable list(); - - /** - * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of - * each SAP HANA on Azure 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 a list of SAP HANA instances in the specified subscription. - */ - PagedIterable list(Context context); - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns - * various properties of each SAP HANA on Azure instance. - * - * @param resourceGroupName Name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA instances in the specified subscription and the resource group. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - HanaInstance getByResourceGroup(String resourceGroupName, String hanaInstanceName); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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 properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String hanaInstanceName, Context context); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void deleteByResourceGroup(String resourceGroupName, String hanaInstanceName); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance name. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void delete(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void restart(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to restart a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void restart(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void start(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to start a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void start(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void shutdown(String resourceGroupName, String hanaInstanceName); - - /** - * The operation to shutdown a SAP HANA instance. - * - * @param resourceGroupName Name of the resource group. - * @param hanaInstanceName Name of the SAP HANA on Azure 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. - */ - void shutdown(String resourceGroupName, String hanaInstanceName, Context context); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - HanaInstance getById(String id); - - /** - * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties of a SAP HANA instance for the specified subscription, resource group, and instance name. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance 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. - */ - void deleteById(String id); - - /** - * Deletes a SAP HANA instance with the specified subscription, resource group, and instance 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. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new HanaInstance resource. - * - * @param name resource name. - * @return the first stage of the new HanaInstance definition. - */ - HanaInstance.DefinitionStages.Blank define(String name); -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HardwareProfile.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HardwareProfile.java deleted file mode 100644 index ac842c08ea33d..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HardwareProfile.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the hardware settings for the HANA instance. */ -@Fluent -public final class HardwareProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HardwareProfile.class); - - /* - * Name of the hardware type (vendor and/or their product name) - */ - @JsonProperty(value = "hardwareType") - private HanaHardwareTypeNamesEnum hardwareType; - - /* - * Specifies the HANA instance SKU. - */ - @JsonProperty(value = "hanaInstanceSize") - private HanaInstanceSizeNamesEnum hanaInstanceSize; - - /** - * Get the hardwareType property: Name of the hardware type (vendor and/or their product name). - * - * @return the hardwareType value. - */ - public HanaHardwareTypeNamesEnum hardwareType() { - return this.hardwareType; - } - - /** - * Set the hardwareType property: Name of the hardware type (vendor and/or their product name). - * - * @param hardwareType the hardwareType value to set. - * @return the HardwareProfile object itself. - */ - public HardwareProfile withHardwareType(HanaHardwareTypeNamesEnum hardwareType) { - this.hardwareType = hardwareType; - return this; - } - - /** - * Get the hanaInstanceSize property: Specifies the HANA instance SKU. - * - * @return the hanaInstanceSize value. - */ - public HanaInstanceSizeNamesEnum hanaInstanceSize() { - return this.hanaInstanceSize; - } - - /** - * Set the hanaInstanceSize property: Specifies the HANA instance SKU. - * - * @param hanaInstanceSize the hanaInstanceSize value to set. - * @return the HardwareProfile object itself. - */ - public HardwareProfile withHanaInstanceSize(HanaInstanceSizeNamesEnum hanaInstanceSize) { - this.hanaInstanceSize = hanaInstanceSize; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/IpAddress.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/IpAddress.java deleted file mode 100644 index 7c8a335e5c143..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/IpAddress.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the IP address of the network interface. */ -@Fluent -public final class IpAddress { - @JsonIgnore private final ClientLogger logger = new ClientLogger(IpAddress.class); - - /* - * Specifies the IP address of the network interface. - */ - @JsonProperty(value = "ipAddress") - private String ipAddress; - - /** - * Get the ipAddress property: Specifies the IP address of the network interface. - * - * @return the ipAddress value. - */ - public String ipAddress() { - return this.ipAddress; - } - - /** - * Set the ipAddress property: Specifies the IP address of the network interface. - * - * @param ipAddress the ipAddress value to set. - * @return the IpAddress object itself. - */ - public IpAddress withIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/NetworkProfile.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/NetworkProfile.java deleted file mode 100644 index 9b0a01c64a10d..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/NetworkProfile.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the network settings for the HANA instance disks. */ -@Fluent -public final class NetworkProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); - - /* - * Specifies the network interfaces for the HANA instance. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /* - * Specifies the circuit id for connecting to express route. - */ - @JsonProperty(value = "circuitId") - private String circuitId; - - /** - * Get the networkInterfaces property: Specifies the network interfaces for the HANA instance. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: Specifies the network interfaces for the HANA instance. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Get the circuitId property: Specifies the circuit id for connecting to express route. - * - * @return the circuitId value. - */ - public String circuitId() { - return this.circuitId; - } - - /** - * Set the circuitId property: Specifies the circuit id for connecting to express route. - * - * @param circuitId the circuitId value to set. - * @return the NetworkProfile object itself. - */ - public NetworkProfile withCircuitId(String circuitId) { - this.circuitId = circuitId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OSProfile.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OSProfile.java deleted file mode 100644 index f733124d05648..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OSProfile.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Specifies the operating system settings for the HANA instance. */ -@Fluent -public final class OSProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OSProfile.class); - - /* - * Specifies the host OS name of the HANA instance. - */ - @JsonProperty(value = "computerName") - private String computerName; - - /* - * This property allows you to specify the type of the OS. - */ - @JsonProperty(value = "osType") - private String osType; - - /* - * Specifies version of operating system. - */ - @JsonProperty(value = "version") - private String version; - - /* - * Specifies the SSH public key used to access the operating system. - */ - @JsonProperty(value = "sshPublicKey") - private String sshPublicKey; - - /** - * Get the computerName property: Specifies the host OS name of the HANA instance. - * - * @return the computerName value. - */ - public String computerName() { - return this.computerName; - } - - /** - * Set the computerName property: Specifies the host OS name of the HANA instance. - * - * @param computerName the computerName value to set. - * @return the OSProfile object itself. - */ - public OSProfile withComputerName(String computerName) { - this.computerName = computerName; - return this; - } - - /** - * Get the osType property: This property allows you to specify the type of the OS. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Set the osType property: This property allows you to specify the type of the OS. - * - * @param osType the osType value to set. - * @return the OSProfile object itself. - */ - public OSProfile withOsType(String osType) { - this.osType = osType; - return this; - } - - /** - * Get the version property: Specifies version of operating system. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Specifies version of operating system. - * - * @param version the version value to set. - * @return the OSProfile object itself. - */ - public OSProfile withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the sshPublicKey property: Specifies the SSH public key used to access the operating system. - * - * @return the sshPublicKey value. - */ - public String sshPublicKey() { - return this.sshPublicKey; - } - - /** - * Set the sshPublicKey property: Specifies the SSH public key used to access the operating system. - * - * @param sshPublicKey the sshPublicKey value to set. - * @return the OSProfile object itself. - */ - public OSProfile withSshPublicKey(String sshPublicKey) { - this.sshPublicKey = sshPublicKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java index 9b025ee38836e..0f02821092c15 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/OperationList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.hanaonazure.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hanaonazure.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** List of HANA operations. */ @Fluent public final class OperationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); - /* * List of HANA operations */ diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java index d87915b98829b..8a4b07b282ea9 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of SAP HANA management operations. + * @return a list of SAP HANA management operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.java new file mode 100644 index 0000000000000..e2006e3941d73 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstance.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.hanaonazure.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; + +/** An immutable client-side representation of ProviderInstance. */ +public interface ProviderInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the typePropertiesType property: The type of provider instance. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the properties property: A JSON string containing the properties of the provider instance. + * + * @return the properties value. + */ + String properties(); + + /** + * Gets the metadata property: A JSON string containing metadata of the provider instance. + * + * @return the metadata value. + */ + String metadata(); + + /** + * Gets the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + HanaProvisioningStatesEnum provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner object. + * + * @return the inner object. + */ + ProviderInstanceInner innerModel(); + + /** The entirety of the ProviderInstance definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProviderInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the ProviderInstance definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProviderInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sapMonitorName. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @return the next definition stage. + */ + WithCreate withExistingSapMonitor(String resourceGroupName, String sapMonitorName); + } + /** + * The stage of the ProviderInstance definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithProperties, + DefinitionStages.WithMetadata { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProviderInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProviderInstance create(Context context); + } + /** The stage of the ProviderInstance definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of provider instance.. + * + * @param typePropertiesType The type of provider instance. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the ProviderInstance definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: A JSON string containing the properties of the provider instance.. + * + * @param properties A JSON string containing the properties of the provider instance. + * @return the next definition stage. + */ + WithCreate withProperties(String properties); + } + /** The stage of the ProviderInstance definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A JSON string containing metadata of the provider instance.. + * + * @param metadata A JSON string containing metadata of the provider instance. + * @return the next definition stage. + */ + WithCreate withMetadata(String metadata); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProviderInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProviderInstance refresh(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancesListResult.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java similarity index 56% rename from sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancesListResult.java rename to sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java index 59bb2f7f20a8f..dec12fc947c4c 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/HanaInstancesListResult.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstanceListResult.java @@ -5,51 +5,47 @@ package com.azure.resourcemanager.hanaonazure.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hanaonazure.fluent.models.HanaInstanceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.hanaonazure.fluent.models.ProviderInstanceInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response from the List HANA Instances operation. */ +/** The response from the List provider instances operation. */ @Fluent -public final class HanaInstancesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HanaInstancesListResult.class); - +public final class ProviderInstanceListResult { /* - * The list of SAP HANA on Azure instances. + * The list of provider instances. */ @JsonProperty(value = "value") - private List value; + private List value; /* - * The URL to get the next set of HANA instances. + * The URL to get the next set of provider instances. */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: The list of SAP HANA on Azure instances. + * Get the value property: The list of provider instances. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: The list of SAP HANA on Azure instances. + * Set the value property: The list of provider instances. * * @param value the value value to set. - * @return the HanaInstancesListResult object itself. + * @return the ProviderInstanceListResult object itself. */ - public HanaInstancesListResult withValue(List value) { + public ProviderInstanceListResult withValue(List value) { this.value = value; return this; } /** - * Get the nextLink property: The URL to get the next set of HANA instances. + * Get the nextLink property: The URL to get the next set of provider instances. * * @return the nextLink value. */ @@ -58,12 +54,12 @@ public String nextLink() { } /** - * Set the nextLink property: The URL to get the next set of HANA instances. + * Set the nextLink property: The URL to get the next set of provider instances. * * @param nextLink the nextLink value to set. - * @return the HanaInstancesListResult object itself. + * @return the ProviderInstanceListResult object itself. */ - public HanaInstancesListResult withNextLink(String nextLink) { + public ProviderInstanceListResult withNextLink(String nextLink) { this.nextLink = nextLink; return this; } diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.java new file mode 100644 index 0000000000000..cd04d4c6e85ec --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/ProviderInstances.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.hanaonazure.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 ProviderInstances. */ +public interface ProviderInstances { + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapMonitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each + * provider instances. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + */ + ProviderInstance get(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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 properties of a provider instance for the specified subscription, resource group, SapMonitor name, and + * resource name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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. + */ + void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor name, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider 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. + */ + void delete(String resourceGroupName, String sapMonitorName, String providerInstanceName, Context context); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor 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, SapMonitor name, and + * resource name along with {@link Response}. + */ + ProviderInstance getById(String id); + + /** + * Gets properties of a provider instance for the specified subscription, resource group, SapMonitor 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, SapMonitor name, and + * resource name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor 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. + */ + void deleteById(String id); + + /** + * Deletes a provider instance for the specified subscription, resource group, SapMonitor 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProviderInstance resource. + * + * @param name resource name. + * @return the first stage of the new ProviderInstance definition. + */ + ProviderInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java new file mode 100644 index 0000000000000..71e9b97c0f067 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitor.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import java.util.Map; + +/** An immutable client-side representation of SapMonitor. */ +public interface SapMonitor { + /** + * 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 provisioningState property: State of provisioning of the HanaInstance. + * + * @return the provisioningState value. + */ + HanaProvisioningStatesEnum provisioningState(); + + /** + * Gets the managedResourceGroupName property: The name of the resource group the SAP Monitor resources get deployed + * into. + * + * @return the managedResourceGroupName value. + */ + String managedResourceGroupName(); + + /** + * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + String logAnalyticsWorkspaceArmId(); + + /** + * Gets the enableCustomerAnalytics property: The value indicating whether to send analytics to Microsoft. + * + * @return the enableCustomerAnalytics value. + */ + Boolean enableCustomerAnalytics(); + + /** + * Gets the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be used for + * monitoring. + * + * @return the logAnalyticsWorkspaceId value. + */ + String logAnalyticsWorkspaceId(); + + /** + * Gets the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that is used for + * monitoring. + * + * @return the logAnalyticsWorkspaceSharedKey value. + */ + String logAnalyticsWorkspaceSharedKey(); + + /** + * Gets the sapMonitorCollectorVersion property: The version of the payload running in the Collector VM. + * + * @return the sapMonitorCollectorVersion value. + */ + String sapMonitorCollectorVersion(); + + /** + * Gets the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + String monitorSubnet(); + + /** + * 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 inner com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner object. + * + * @return the inner object. + */ + SapMonitorInner innerModel(); + + /** The entirety of the SapMonitor definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SapMonitor definition stages. */ + interface DefinitionStages { + /** The first stage of the SapMonitor definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SapMonitor 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 SapMonitor definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SapMonitor 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.WithLogAnalyticsWorkspaceArmId, + DefinitionStages.WithEnableCustomerAnalytics, + DefinitionStages.WithLogAnalyticsWorkspaceId, + DefinitionStages.WithLogAnalyticsWorkspaceSharedKey, + DefinitionStages.WithMonitorSubnet { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapMonitor create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapMonitor create(Context context); + } + /** The stage of the SapMonitor 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 SapMonitor definition allowing to specify logAnalyticsWorkspaceArmId. */ + interface WithLogAnalyticsWorkspaceArmId { + /** + * Specifies the logAnalyticsWorkspaceArmId property: 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 monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId); + } + /** The stage of the SapMonitor definition allowing to specify enableCustomerAnalytics. */ + interface WithEnableCustomerAnalytics { + /** + * Specifies the enableCustomerAnalytics property: The value indicating whether to send analytics to + * Microsoft. + * + * @param enableCustomerAnalytics The value indicating whether to send analytics to Microsoft. + * @return the next definition stage. + */ + WithCreate withEnableCustomerAnalytics(Boolean enableCustomerAnalytics); + } + /** The stage of the SapMonitor definition allowing to specify logAnalyticsWorkspaceId. */ + interface WithLogAnalyticsWorkspaceId { + /** + * Specifies the logAnalyticsWorkspaceId property: The workspace ID of the log analytics workspace to be + * used for monitoring. + * + * @param logAnalyticsWorkspaceId The workspace ID of the log analytics workspace to be used for monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceId(String logAnalyticsWorkspaceId); + } + /** The stage of the SapMonitor definition allowing to specify logAnalyticsWorkspaceSharedKey. */ + interface WithLogAnalyticsWorkspaceSharedKey { + /** + * Specifies the logAnalyticsWorkspaceSharedKey property: The shared key of the log analytics workspace that + * is used for monitoring. + * + * @param logAnalyticsWorkspaceSharedKey The shared key of the log analytics workspace that is used for + * monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceSharedKey(String logAnalyticsWorkspaceSharedKey); + } + /** The stage of the SapMonitor definition allowing to specify monitorSubnet. */ + interface WithMonitorSubnet { + /** + * Specifies the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet The subnet which the SAP monitor will be deployed in. + * @return the next definition stage. + */ + WithCreate withMonitorSubnet(String monitorSubnet); + } + } + /** + * Begins update for the SapMonitor resource. + * + * @return the stage of resource update. + */ + SapMonitor.Update update(); + + /** The template for SapMonitor update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapMonitor apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapMonitor apply(Context context); + } + /** The SapMonitor update stages. */ + interface UpdateStages { + /** The stage of the SapMonitor update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags field of the resource.. + * + * @param tags Tags field of the resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapMonitor refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapMonitor refresh(Context context); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.java new file mode 100644 index 0000000000000..a6837c396333b --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitorListResult.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.hanaonazure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hanaonazure.fluent.models.SapMonitorInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List SAP monitors operation. */ +@Fluent +public final class SapMonitorListResult { + /* + * The list of SAP monitors. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of SAP monitors. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of SAP monitors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of SAP monitors. + * + * @param value the value value to set. + * @return the SapMonitorListResult object itself. + */ + public SapMonitorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of SAP monitors. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of SAP monitors. + * + * @param nextLink the nextLink value to set. + * @return the SapMonitorListResult object itself. + */ + public SapMonitorListResult 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/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java new file mode 100644 index 0000000000000..a7a2c26ce1fa7 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/SapMonitors.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.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 SapMonitors. */ +public interface SapMonitors { + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP + * monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + SapMonitor getByResourceGroup(String resourceGroupName, String sapMonitorName); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapMonitorName, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sapMonitorName); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param resourceGroupName Name of the resource group. + * @param sapMonitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapMonitorName, Context context); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + SapMonitor getById(String id); + + /** + * Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a SAP monitor with the specified subscription, resource group, and monitor 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapMonitor resource. + * + * @param name resource name. + * @return the first stage of the new SapMonitor definition. + */ + SapMonitor.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/StorageProfile.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/StorageProfile.java deleted file mode 100644 index deee550573bc6..0000000000000 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/StorageProfile.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hanaonazure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Specifies the storage settings for the HANA instance disks. */ -@Fluent -public final class StorageProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); - - /* - * IP Address to connect to storage. - */ - @JsonProperty(value = "nfsIpAddress") - private String nfsIpAddress; - - /* - * Specifies information about the operating system disk used by the hana - * instance. - */ - @JsonProperty(value = "osDisks") - private List osDisks; - - /** - * Get the nfsIpAddress property: IP Address to connect to storage. - * - * @return the nfsIpAddress value. - */ - public String nfsIpAddress() { - return this.nfsIpAddress; - } - - /** - * Set the nfsIpAddress property: IP Address to connect to storage. - * - * @param nfsIpAddress the nfsIpAddress value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withNfsIpAddress(String nfsIpAddress) { - this.nfsIpAddress = nfsIpAddress; - return this; - } - - /** - * Get the osDisks property: Specifies information about the operating system disk used by the hana instance. - * - * @return the osDisks value. - */ - public List osDisks() { - return this.osDisks; - } - - /** - * Set the osDisks property: Specifies information about the operating system disk used by the hana instance. - * - * @param osDisks the osDisks value to set. - * @return the StorageProfile object itself. - */ - public StorageProfile withOsDisks(List osDisks) { - this.osDisks = osDisks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (osDisks() != null) { - osDisks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java index 6ec47474e3d32..126021232a2db 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/main/java/com/azure/resourcemanager/hanaonazure/models/Tags.java @@ -5,24 +5,22 @@ package com.azure.resourcemanager.hanaonazure.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Tags field of the HANA instance. */ +/** Tags field of the resource. */ @Fluent public final class Tags { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Tags.class); - /* - * Tags field of the HANA instance. + * Tags field of the resource. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the tags property: Tags field of the HANA instance. + * Get the tags property: Tags field of the resource. * * @return the tags value. */ @@ -31,7 +29,7 @@ public Map tags() { } /** - * Set the tags property: Tags field of the HANA instance. + * Set the tags property: Tags field of the resource. * * @param tags the tags value to set. * @return the Tags object itself. diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/OperationsListSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..5dbdc18271e54 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/OperationsListSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/HanaOperations_List.json + */ + /** + * Sample code: List all HANA management operations supported by HANA RP. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllHANAManagementOperationsSupportedByHANARP( + com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesCreateSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesCreateSamples.java new file mode 100644 index 0000000000000..74ba488da72e1 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.generated; + +/** Samples for ProviderInstances Create. */ +public final class ProviderInstancesCreateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP Monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void createASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingSapMonitor("myResourceGroup", "mySapMonitor") + .withTypePropertiesType("hana") + .withProperties( + "{\"hostname\":\"10.0.0.6\",\"dbName\":\"SYSTEMDB\",\"sqlPort\":30013,\"dbUsername\":\"SYSTEM\",\"dbPassword\":\"PASSWORD\"}") + .withMetadata("{\"key\":\"value\"}") + .create(); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesDeleteSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesDeleteSamples.java new file mode 100644 index 0000000000000..a1cb6fceded13 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesDeleteSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for ProviderInstances Delete. */ +public final class ProviderInstancesDeleteSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deletesASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.providerInstances().delete("myResourceGroup", "mySapMonitor", "myProviderInstance", Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesGetSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesGetSamples.java new file mode 100644 index 0000000000000..882b6387718e5 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for ProviderInstances Get. */ +public final class ProviderInstancesGetSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesListSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesListSamples.java new file mode 100644 index 0000000000000..9a40fa6cfbbcf --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/ProviderInstancesListSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for ProviderInstances List. */ +public final class ProviderInstancesListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/ProviderInstances_List.json + */ + /** + * Sample code: List all SAP Monitors in a subscription. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.providerInstances().list("myResourceGroup", "mySapMonitor", Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsCreateSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsCreateSamples.java new file mode 100644 index 0000000000000..60959fae25fed --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsCreateSamples.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.hanaonazure.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapMonitors Create. */ +public final class SapMonitorsCreateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Create.json + */ + /** + * Sample code: Create a SAP Monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void createASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager + .sapMonitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "value")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withEnableCustomerAnalytics(true) + .withLogAnalyticsWorkspaceId("00000000-0000-0000-0000-000000000000") + .withLogAnalyticsWorkspaceSharedKey( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000==") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .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/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsDeleteSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsDeleteSamples.java new file mode 100644 index 0000000000000..3fd847db932f2 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsDeleteSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for SapMonitors Delete. */ +public final class SapMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deletesASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().delete("myResourceGroup", "mySapMonitor", Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsGetByResourceGroupSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..721a5d5161522 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsGetByResourceGroupSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for SapMonitors GetByResourceGroup. */ +public final class SapMonitorsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void getPropertiesOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsListSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsListSamples.java new file mode 100644 index 0000000000000..99574c695d5ec --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsListSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; + +/** Samples for SapMonitors List. */ +public final class SapMonitorsListSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_List.json + */ + /** + * Sample code: List all SAP Monitors in a subscription. + * + * @param manager Entry point to HanaManager. + */ + public static void listAllSAPMonitorsInASubscription(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + manager.sapMonitors().list(Context.NONE); + } +} diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsUpdateSamples.java b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsUpdateSamples.java new file mode 100644 index 0000000000000..f975bada98126 --- /dev/null +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/src/samples/java/com/azure/resourcemanager/hanaonazure/generated/SapMonitorsUpdateSamples.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.hanaonazure.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hanaonazure.models.SapMonitor; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapMonitors Update. */ +public final class SapMonitorsUpdateSamples { + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void deleteTagsFieldOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + SapMonitor resource = + manager + .sapMonitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).apply(); + } + + /* + * x-ms-original-file: specification/hanaonazure/resource-manager/Microsoft.HanaOnAzure/preview/2020-02-07-preview/examples/SapMonitors_PatchTags.json + */ + /** + * Sample code: Update Tags field of a SAP monitor. + * + * @param manager Entry point to HanaManager. + */ + public static void updateTagsFieldOfASAPMonitor(com.azure.resourcemanager.hanaonazure.HanaManager manager) { + SapMonitor resource = + manager + .sapMonitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("testkey", "testvalue")).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; + } +}