From f692f6a326c66a3a645965db01dc209621f01887 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 20 Oct 2021 08:58:13 +0000 Subject: [PATCH] CodeGen from PR 16477 in Azure/azure-rest-api-specs Merge bd4f5d37c61a7dc0e606583f4142f59ccff7f503 into fbf20b06614f6cfeda0f69abb4893d8bee40ba35 --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-synapse/README.md | 2 +- .../azure-resourcemanager-synapse/SAMPLE.md | 201 +- .../synapse/SynapseManager.java | 14 +- .../synapse/fluent/KustoPoolsClient.java | 825 ++++ .../fluent/KustoPoolsOperationsClient.java | 838 ---- .../fluent/SynapseManagementClient.java | 7 - .../models/EventHubConnectionProperties.java | 29 + .../synapse/fluent/models/SqlPoolInner.java | 33 +- .../models/SqlPoolResourceProperties.java | 52 +- .../synapse/implementation/KustoPoolImpl.java | 44 +- .../implementation/KustoPoolsClientImpl.java | 3851 ++++++++++++++++ .../implementation/KustoPoolsImpl.java | 327 ++ .../KustoPoolsOperationsClientImpl.java | 3912 ----------------- .../KustoPoolsOperationsImpl.java | 361 -- .../synapse/implementation/SqlPoolImpl.java | 5 +- .../SynapseManagementClientImpl.java | 14 - .../synapse/models/CreateMode.java | 40 + .../models/EventHubDataConnection.java | 25 + .../synapse/models/KustoPools.java | 404 ++ .../synapse/models/KustoPoolsOperations.java | 415 -- .../synapse/models/SqlPool.java | 70 +- .../synapse/models/SqlPoolPatchInfo.java | 32 +- ...stoPoolsAddLanguageExtensionsSamples.java} | 6 +- ...stoPoolsCheckNameAvailabilitySamples.java} | 6 +- ...a => KustoPoolsCreateOrUpdateSamples.java} | 6 +- ...ples.java => KustoPoolsDeleteSamples.java} | 6 +- ...oPoolsDetachFollowerDatabasesSamples.java} | 6 +- ...Samples.java => KustoPoolsGetSamples.java} | 6 +- ... => KustoPoolsListByWorkspaceSamples.java} | 6 +- ...stoPoolsListFollowerDatabasesSamples.java} | 8 +- ...toPoolsListLanguageExtensionsSamples.java} | 8 +- ...amples.java => KustoPoolsListSamples.java} | 4 +- ... KustoPoolsListSkusByResourceSamples.java} | 6 +- ...PoolsRemoveLanguageExtensionsSamples.java} | 6 +- ...mples.java => KustoPoolsStartSamples.java} | 6 +- ...amples.java => KustoPoolsStopSamples.java} | 6 +- ...ples.java => KustoPoolsUpdateSamples.java} | 6 +- .../generated/SqlPoolsCreateSamples.java | 3 +- .../generated/SqlPoolsUpdateSamples.java | 3 +- 40 files changed, 5840 insertions(+), 5763 deletions(-) delete mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsOperationsClient.java delete mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsClientImpl.java delete mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateMode.java delete mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolsOperations.java rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationAddLanguageExtensionsSamples.java => KustoPoolsAddLanguageExtensionsSamples.java} (89%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationCheckNameAvailabilitySamples.java => KustoPoolsCheckNameAvailabilitySamples.java} (84%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationCreateOrUpdateSamples.java => KustoPoolsCreateOrUpdateSamples.java} (88%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationDeleteSamples.java => KustoPoolsDeleteSamples.java} (74%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationDetachFollowerDatabasesSamples.java => KustoPoolsDetachFollowerDatabasesSamples.java} (88%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationGetSamples.java => KustoPoolsGetSamples.java} (84%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationListByWorkspaceSamples.java => KustoPoolsListByWorkspaceSamples.java} (74%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationListFollowerDatabasesSamples.java => KustoPoolsListFollowerDatabasesSamples.java} (70%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationListLanguageExtensionsSamples.java => KustoPoolsListLanguageExtensionsSamples.java} (69%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolListSamples.java => KustoPoolsListSamples.java} (89%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationListSkusByResourceSamples.java => KustoPoolsListSkusByResourceSamples.java} (82%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationRemoveLanguageExtensionsSamples.java => KustoPoolsRemoveLanguageExtensionsSamples.java} (89%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationStartSamples.java => KustoPoolsStartSamples.java} (74%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationStopSamples.java => KustoPoolsStopSamples.java} (74%) rename sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/{KustoPoolsOperationUpdateSamples.java => KustoPoolsUpdateSamples.java} (90%) diff --git a/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md index 28bf85fcc700..f30aaf186b46 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md +++ b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2021-10-20) + +- Azure Resource Manager Synapse client library for Java. This package contains Microsoft Azure SDK for Synapse Management SDK. Azure Synapse Analytics Management Client. Package tag package-composite-v2. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/synapse/azure-resourcemanager-synapse/README.md b/sdk/synapse/azure-resourcemanager-synapse/README.md index 339ec20d40a5..864c09378d34 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/README.md +++ b/sdk/synapse/azure-resourcemanager-synapse/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-synapse - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/synapse/azure-resourcemanager-synapse/SAMPLE.md b/sdk/synapse/azure-resourcemanager-synapse/SAMPLE.md index d97fce07b02f..e7405a707888 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/SAMPLE.md +++ b/sdk/synapse/azure-resourcemanager-synapse/SAMPLE.md @@ -101,10 +101,6 @@ - [List](#kustooperations_list) -## KustoPool - -- [List](#kustopool_list) - ## KustoPoolAttachedDatabaseConfigurations - [CreateOrUpdate](#kustopoolattacheddatabaseconfigurations_createorupdate) @@ -150,22 +146,23 @@ - [Get](#kustopoolprincipalassignments_get) - [List](#kustopoolprincipalassignments_list) -## KustoPoolsOperation - -- [AddLanguageExtensions](#kustopoolsoperation_addlanguageextensions) -- [CheckNameAvailability](#kustopoolsoperation_checknameavailability) -- [CreateOrUpdate](#kustopoolsoperation_createorupdate) -- [Delete](#kustopoolsoperation_delete) -- [DetachFollowerDatabases](#kustopoolsoperation_detachfollowerdatabases) -- [Get](#kustopoolsoperation_get) -- [ListByWorkspace](#kustopoolsoperation_listbyworkspace) -- [ListFollowerDatabases](#kustopoolsoperation_listfollowerdatabases) -- [ListLanguageExtensions](#kustopoolsoperation_listlanguageextensions) -- [ListSkusByResource](#kustopoolsoperation_listskusbyresource) -- [RemoveLanguageExtensions](#kustopoolsoperation_removelanguageextensions) -- [Start](#kustopoolsoperation_start) -- [Stop](#kustopoolsoperation_stop) -- [Update](#kustopoolsoperation_update) +## KustoPools + +- [AddLanguageExtensions](#kustopools_addlanguageextensions) +- [CheckNameAvailability](#kustopools_checknameavailability) +- [CreateOrUpdate](#kustopools_createorupdate) +- [Delete](#kustopools_delete) +- [DetachFollowerDatabases](#kustopools_detachfollowerdatabases) +- [Get](#kustopools_get) +- [List](#kustopools_list) +- [ListByWorkspace](#kustopools_listbyworkspace) +- [ListFollowerDatabases](#kustopools_listfollowerdatabases) +- [ListLanguageExtensions](#kustopools_listlanguageextensions) +- [ListSkusByResource](#kustopools_listskusbyresource) +- [RemoveLanguageExtensions](#kustopools_removelanguageextensions) +- [Start](#kustopools_start) +- [Stop](#kustopools_stop) +- [Update](#kustopools_update) ## LibrariesOperation @@ -1828,27 +1825,6 @@ public final class KustoOperationsListSamples { } ``` -### KustoPool_List - -```java -import com.azure.core.util.Context; - -/** Samples for KustoPool List. */ -public final class KustoPoolListSamples { - /* - * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json - */ - /** - * Sample code: KustoPoolsListSkus. - * - * @param manager Entry point to SynapseManager. - */ - public static void kustoPoolsListSkus(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPools().list(Context.NONE); - } -} -``` - ### KustoPoolAttachedDatabaseConfigurations_CreateOrUpdate ```java @@ -2646,7 +2622,7 @@ public final class KustoPoolPrincipalAssignmentsListSamples { } ``` -### KustoPoolsOperation_AddLanguageExtensions +### KustoPools_AddLanguageExtensions ```java import com.azure.core.util.Context; @@ -2655,8 +2631,8 @@ import com.azure.resourcemanager.synapse.models.LanguageExtensionName; import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; import java.util.Arrays; -/** Samples for KustoPoolsOperation AddLanguageExtensions. */ -public final class KustoPoolsOperationAddLanguageExtensionsSamples { +/** Samples for KustoPools AddLanguageExtensions. */ +public final class KustoPoolsAddLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsAdd.json */ @@ -2667,7 +2643,7 @@ public final class KustoPoolsOperationAddLanguageExtensionsSamples { */ public static void kustoPoolAddLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .addLanguageExtensions( "kustorptest", "kustoclusterrptest4", @@ -2683,14 +2659,14 @@ public final class KustoPoolsOperationAddLanguageExtensionsSamples { } ``` -### KustoPoolsOperation_CheckNameAvailability +### KustoPools_CheckNameAvailability ```java import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; -/** Samples for KustoPoolsOperation CheckNameAvailability. */ -public final class KustoPoolsOperationCheckNameAvailabilitySamples { +/** Samples for KustoPools CheckNameAvailability. */ +public final class KustoPoolsCheckNameAvailabilitySamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCheckNameAvailability.json */ @@ -2701,22 +2677,22 @@ public final class KustoPoolsOperationCheckNameAvailabilitySamples { */ public static void kustoPoolsCheckNameAvailability(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .checkNameAvailabilityWithResponse( "westus", new KustoPoolCheckNameRequest().withName("kustoclusterrptest4"), Context.NONE); } } ``` -### KustoPoolsOperation_CreateOrUpdate +### KustoPools_CreateOrUpdate ```java import com.azure.resourcemanager.synapse.models.AzureSku; import com.azure.resourcemanager.synapse.models.SkuName; import com.azure.resourcemanager.synapse.models.SkuSize; -/** Samples for KustoPoolsOperation CreateOrUpdate. */ -public final class KustoPoolsOperationCreateOrUpdateSamples { +/** Samples for KustoPools CreateOrUpdate. */ +public final class KustoPoolsCreateOrUpdateSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCreateOrUpdate.json */ @@ -2727,7 +2703,7 @@ public final class KustoPoolsOperationCreateOrUpdateSamples { */ public static void kustoPoolsCreateOrUpdate(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .define("kustoclusterrptest4") .withRegion("westus") .withExistingWorkspace("synapseWorkspaceName", "kustorptest") @@ -2740,13 +2716,13 @@ public final class KustoPoolsOperationCreateOrUpdateSamples { } ``` -### KustoPoolsOperation_Delete +### KustoPools_Delete ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Delete. */ -public final class KustoPoolsOperationDeleteSamples { +/** Samples for KustoPools Delete. */ +public final class KustoPoolsDeleteSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsDelete.json */ @@ -2756,19 +2732,19 @@ public final class KustoPoolsOperationDeleteSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsDelete(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().delete("kustorptest", "kustorptest", "kustoclusterrptest4", Context.NONE); + manager.kustoPools().delete("kustorptest", "kustorptest", "kustoclusterrptest4", Context.NONE); } } ``` -### KustoPoolsOperation_DetachFollowerDatabases +### KustoPools_DetachFollowerDatabases ```java import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; -/** Samples for KustoPoolsOperation DetachFollowerDatabases. */ -public final class KustoPoolsOperationDetachFollowerDatabasesSamples { +/** Samples for KustoPools DetachFollowerDatabases. */ +public final class KustoPoolsDetachFollowerDatabasesSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesDetach.json */ @@ -2779,7 +2755,7 @@ public final class KustoPoolsOperationDetachFollowerDatabasesSamples { */ public static void kustoPoolDetachFollowerDatabases(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .detachFollowerDatabases( "kustorptest", "kustoclusterrptest4", @@ -2793,13 +2769,13 @@ public final class KustoPoolsOperationDetachFollowerDatabasesSamples { } ``` -### KustoPoolsOperation_Get +### KustoPools_Get ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Get. */ -public final class KustoPoolsOperationGetSamples { +/** Samples for KustoPools Get. */ +public final class KustoPoolsGetSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsGet.json */ @@ -2810,19 +2786,40 @@ public final class KustoPoolsOperationGetSamples { */ public static void kustoPoolsGet(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .getWithResponse("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_ListByWorkspace +### KustoPools_List ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListByWorkspace. */ -public final class KustoPoolsOperationListByWorkspaceSamples { +/** Samples for KustoPools List. */ +public final class KustoPoolsListSamples { + /* + * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json + */ + /** + * Sample code: KustoPoolsListSkus. + * + * @param manager Entry point to SynapseManager. + */ + public static void kustoPoolsListSkus(com.azure.resourcemanager.synapse.SynapseManager manager) { + manager.kustoPools().list(Context.NONE); + } +} +``` + +### KustoPools_ListByWorkspace + +```java +import com.azure.core.util.Context; + +/** Samples for KustoPools ListByWorkspace. */ +public final class KustoPoolsListByWorkspaceSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListByWorkspace.json */ @@ -2832,18 +2829,18 @@ public final class KustoPoolsOperationListByWorkspaceSamples { * @param manager Entry point to SynapseManager. */ public static void listKustoPoolsInAWorkspace(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().listByWorkspaceWithResponse("kustorptest", "kustorptest", Context.NONE); + manager.kustoPools().listByWorkspaceWithResponse("kustorptest", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_ListFollowerDatabases +### KustoPools_ListFollowerDatabases ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListFollowerDatabases. */ -public final class KustoPoolsOperationListFollowerDatabasesSamples { +/** Samples for KustoPools ListFollowerDatabases. */ +public final class KustoPoolsListFollowerDatabasesSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesList.json */ @@ -2853,20 +2850,18 @@ public final class KustoPoolsOperationListFollowerDatabasesSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolListFollowerDatabases(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager - .kustoPoolsOperations() - .listFollowerDatabases("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().listFollowerDatabases("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_ListLanguageExtensions +### KustoPools_ListLanguageExtensions ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListLanguageExtensions. */ -public final class KustoPoolsOperationListLanguageExtensionsSamples { +/** Samples for KustoPools ListLanguageExtensions. */ +public final class KustoPoolsListLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsList.json */ @@ -2876,20 +2871,18 @@ public final class KustoPoolsOperationListLanguageExtensionsSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolListLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager - .kustoPoolsOperations() - .listLanguageExtensions("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().listLanguageExtensions("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_ListSkusByResource +### KustoPools_ListSkusByResource ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListSkusByResource. */ -public final class KustoPoolsOperationListSkusByResourceSamples { +/** Samples for KustoPools ListSkusByResource. */ +public final class KustoPoolsListSkusByResourceSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListResourceSkus.json */ @@ -2900,13 +2893,13 @@ public final class KustoPoolsOperationListSkusByResourceSamples { */ public static void kustoPoolsListResourceSkus(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .listSkusByResource("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_RemoveLanguageExtensions +### KustoPools_RemoveLanguageExtensions ```java import com.azure.core.util.Context; @@ -2915,8 +2908,8 @@ import com.azure.resourcemanager.synapse.models.LanguageExtensionName; import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; import java.util.Arrays; -/** Samples for KustoPoolsOperation RemoveLanguageExtensions. */ -public final class KustoPoolsOperationRemoveLanguageExtensionsSamples { +/** Samples for KustoPools RemoveLanguageExtensions. */ +public final class KustoPoolsRemoveLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsRemove.json */ @@ -2927,7 +2920,7 @@ public final class KustoPoolsOperationRemoveLanguageExtensionsSamples { */ public static void kustoPoolRemoveLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .removeLanguageExtensions( "kustorptest", "kustoclusterrptest4", @@ -2943,13 +2936,13 @@ public final class KustoPoolsOperationRemoveLanguageExtensionsSamples { } ``` -### KustoPoolsOperation_Start +### KustoPools_Start ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Start. */ -public final class KustoPoolsOperationStartSamples { +/** Samples for KustoPools Start. */ +public final class KustoPoolsStartSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStart.json */ @@ -2959,18 +2952,18 @@ public final class KustoPoolsOperationStartSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsStop(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().start("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().start("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_Stop +### KustoPools_Stop ```java import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Stop. */ -public final class KustoPoolsOperationStopSamples { +/** Samples for KustoPools Stop. */ +public final class KustoPoolsStopSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStop.json */ @@ -2980,12 +2973,12 @@ public final class KustoPoolsOperationStopSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsStop(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().stop("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().stop("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } ``` -### KustoPoolsOperation_Update +### KustoPools_Update ```java import com.azure.core.util.Context; @@ -2994,8 +2987,8 @@ import com.azure.resourcemanager.synapse.models.KustoPool; import com.azure.resourcemanager.synapse.models.SkuName; import com.azure.resourcemanager.synapse.models.SkuSize; -/** Samples for KustoPoolsOperation Update. */ -public final class KustoPoolsOperationUpdateSamples { +/** Samples for KustoPools Update. */ +public final class KustoPoolsUpdateSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsUpdate.json */ @@ -3007,7 +3000,7 @@ public final class KustoPoolsOperationUpdateSamples { public static void kustoPoolsUpdate(com.azure.resourcemanager.synapse.SynapseManager manager) { KustoPool resource = manager - .kustoPoolsOperations() + .kustoPools() .getWithResponse("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE) .getValue(); resource @@ -5501,6 +5494,7 @@ public final class SqlPoolWorkloadGroupListSamples { ### SqlPools_Create ```java +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.StorageAccountType; import java.util.HashMap; @@ -5528,7 +5522,7 @@ public final class SqlPoolsCreateSamples { .withCollation("") .withSourceDatabaseId("") .withRecoverableDatabaseId("") - .withCreateMode("") + .withCreateMode(CreateMode.fromString("")) .withStorageAccountType(StorageAccountType.LRS) .create(); } @@ -5699,6 +5693,7 @@ public final class SqlPoolsResumeSamples { ```java import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.SqlPool; import java.time.OffsetDateTime; @@ -5730,7 +5725,7 @@ public final class SqlPoolsUpdateSamples { .withSourceDatabaseId("") .withRecoverableDatabaseId("") .withRestorePointInTime(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) - .withCreateMode("") + .withCreateMode(CreateMode.fromString("")) .withCreationDate(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) .apply(); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java index 2362f42abdfa..1d9cf591f9b1 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java @@ -45,7 +45,6 @@ import com.azure.resourcemanager.synapse.implementation.KustoPoolDatabasesImpl; import com.azure.resourcemanager.synapse.implementation.KustoPoolPrincipalAssignmentsImpl; import com.azure.resourcemanager.synapse.implementation.KustoPoolsImpl; -import com.azure.resourcemanager.synapse.implementation.KustoPoolsOperationsImpl; import com.azure.resourcemanager.synapse.implementation.LibrariesImpl; import com.azure.resourcemanager.synapse.implementation.LibrariesOperationsImpl; import com.azure.resourcemanager.synapse.implementation.OperationsImpl; @@ -119,7 +118,6 @@ import com.azure.resourcemanager.synapse.models.KustoPoolDatabases; import com.azure.resourcemanager.synapse.models.KustoPoolPrincipalAssignments; import com.azure.resourcemanager.synapse.models.KustoPools; -import com.azure.resourcemanager.synapse.models.KustoPoolsOperations; import com.azure.resourcemanager.synapse.models.Libraries; import com.azure.resourcemanager.synapse.models.LibrariesOperations; import com.azure.resourcemanager.synapse.models.Operations; @@ -308,8 +306,6 @@ public final class SynapseManager { private KustoPools kustoPools; - private KustoPoolsOperations kustoPoolsOperations; - private KustoPoolChildResources kustoPoolChildResources; private KustoPoolAttachedDatabaseConfigurations kustoPoolAttachedDatabaseConfigurations; @@ -458,7 +454,7 @@ public SynapseManager authenticate(TokenCredential credential, AzureProfile prof .append("-") .append("com.azure.resourcemanager.synapse") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -1080,14 +1076,6 @@ public KustoPools kustoPools() { return kustoPools; } - /** @return Resource collection API of KustoPoolsOperations. */ - public KustoPoolsOperations kustoPoolsOperations() { - if (this.kustoPoolsOperations == null) { - this.kustoPoolsOperations = new KustoPoolsOperationsImpl(clientObject.getKustoPoolsOperations(), this); - } - return kustoPoolsOperations; - } - /** @return Resource collection API of KustoPoolChildResources. */ public KustoPoolChildResources kustoPoolChildResources() { if (this.kustoPoolChildResources == null) { diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsClient.java index 2e0d19091ead..c61e16689725 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsClient.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsClient.java @@ -7,8 +7,20 @@ 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.synapse.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; +import com.azure.resourcemanager.synapse.models.KustoPoolUpdate; +import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; /** An instance of this class provides access to all the operations defined in KustoPoolsClient. */ public interface KustoPoolsClient { @@ -33,4 +45,817 @@ public interface KustoPoolsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName); + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, KustoPoolCheckNameRequest kustoPoolName, Context context); + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolListResultInner listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner get(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KustoPoolInner> beginCreateOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KustoPoolInner> beginCreateOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner createOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch); + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner createOrUpdate( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters); + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner createOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KustoPoolInner> beginUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch); + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KustoPoolInner> beginUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context); + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner update( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch); + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner update( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters); + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KustoPoolInner update( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String workspaceName, String resourceGroupName, String kustoPoolName); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String workspaceName, String resourceGroupName, String kustoPoolName, Context context); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName, Context context); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAddLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRemoveLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRemoveLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDetachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDetachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsOperationsClient.java deleted file mode 100644 index 40572f103168..000000000000 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsOperationsClient.java +++ /dev/null @@ -1,838 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.synapse.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.synapse.fluent.models.AzureResourceSkuInner; -import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; -import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; -import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; -import com.azure.resourcemanager.synapse.models.KustoPoolUpdate; -import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; - -/** An instance of this class provides access to all the operations defined in KustoPoolsOperationsClient. */ -public interface KustoPoolsOperationsClient { - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameResultInner checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName); - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - String location, KustoPoolCheckNameRequest kustoPoolName, Context context); - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolListResultInner listByWorkspace(String resourceGroupName, String workspaceName); - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, Context context); - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner get(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, KustoPoolInner> beginCreateOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch); - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, KustoPoolInner> beginCreateOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context); - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner createOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch); - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner createOrUpdate( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters); - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner createOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context); - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, KustoPoolInner> beginUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch); - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, KustoPoolInner> beginUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context); - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner update( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch); - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner update( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters); - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - KustoPoolInner update( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String workspaceName, String resourceGroupName, String kustoPoolName); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String workspaceName, String resourceGroupName, String kustoPoolName, Context context); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName, Context context); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginAddLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginAddLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRemoveLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRemoveLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context); - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDetachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDetachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context); -} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java index 8986c082e05b..d1e5808b42f0 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java @@ -500,13 +500,6 @@ public interface SynapseManagementClient { */ KustoPoolsClient getKustoPools(); - /** - * Gets the KustoPoolsOperationsClient object to access its operations. - * - * @return the KustoPoolsOperationsClient object. - */ - KustoPoolsOperationsClient getKustoPoolsOperations(); - /** * Gets the KustoPoolChildResourcesClient object to access its operations. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EventHubConnectionProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EventHubConnectionProperties.java index 2528ded25597..15dc22c67a2d 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EventHubConnectionProperties.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EventHubConnectionProperties.java @@ -69,6 +69,13 @@ public final class EventHubConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ResourceProvisioningState provisioningState; + /* + * The resource ID of a managed identity (system or user assigned) to be + * used to authenticate with event hub. + */ + @JsonProperty(value = "managedIdentityResourceId") + private String managedIdentityResourceId; + /** * Get the eventHubResourceId property: The resource ID of the event hub to be used to create a data connection. * @@ -224,6 +231,28 @@ public ResourceProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the managedIdentityResourceId property: The resource ID of a managed identity (system or user assigned) to be + * used to authenticate with event hub. + * + * @return the managedIdentityResourceId value. + */ + public String managedIdentityResourceId() { + return this.managedIdentityResourceId; + } + + /** + * Set the managedIdentityResourceId property: The resource ID of a managed identity (system or user assigned) to be + * used to authenticate with event hub. + * + * @param managedIdentityResourceId the managedIdentityResourceId value to set. + * @return the EventHubConnectionProperties object itself. + */ + public EventHubConnectionProperties withManagedIdentityResourceId(String managedIdentityResourceId) { + this.managedIdentityResourceId = managedIdentityResourceId; + return this; + } + /** * Validates the instance. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java index 47d9f5ef548a..3dd5ecd2f5d3 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.StorageAccountType; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -236,21 +237,45 @@ public SqlPoolInner withRestorePointInTime(OffsetDateTime restorePointInTime) { } /** - * Get the createMode property: What is this?. + * Get the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @return the createMode value. */ - public String createMode() { + public CreateMode createMode() { return this.innerProperties() == null ? null : this.innerProperties().createMode(); } /** - * Set the createMode property: What is this?. + * Set the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @param createMode the createMode value to set. * @return the SqlPoolInner object itself. */ - public SqlPoolInner withCreateMode(String createMode) { + public SqlPoolInner withCreateMode(CreateMode createMode) { if (this.innerProperties() == null) { this.innerProperties = new SqlPoolResourceProperties(); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolResourceProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolResourceProperties.java index c04bc2ed548a..f047c0959ae9 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolResourceProperties.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolResourceProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.StorageAccountType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -59,10 +60,25 @@ public final class SqlPoolResourceProperties { private OffsetDateTime restorePointInTime; /* - * What is this? + * Specifies the mode of sql pool creation. + * + * Default: regular sql pool creation. + * + * PointInTimeRestore: Creates a sql pool by restoring a point in time + * backup of an existing sql pool. sourceDatabaseId must be specified as + * the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + * Recovery: Creates a sql pool by a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverableDatabaseId to + * restore. + * + * Restore: Creates a sql pool by restoring a backup of a deleted sql + * pool. SourceDatabaseId should be the sql pool's original resource ID. + * SourceDatabaseId and sourceDatabaseDeletionDate must be specified. */ @JsonProperty(value = "createMode") - private String createMode; + private CreateMode createMode; /* * Date the SQL pool was created @@ -223,21 +239,45 @@ public SqlPoolResourceProperties withRestorePointInTime(OffsetDateTime restorePo } /** - * Get the createMode property: What is this?. + * Get the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @return the createMode value. */ - public String createMode() { + public CreateMode createMode() { return this.createMode; } /** - * Set the createMode property: What is this?. + * Set the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @param createMode the createMode value to set. * @return the SqlPoolResourceProperties object itself. */ - public SqlPoolResourceProperties withCreateMode(String createMode) { + public SqlPoolResourceProperties withCreateMode(CreateMode createMode) { this.createMode = createMode; return this; } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolImpl.java index 11cac27a767e..218c79a49a41 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolImpl.java @@ -144,7 +144,7 @@ public KustoPool create() { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .createOrUpdate( workspaceName, resourceGroupName, @@ -160,7 +160,7 @@ public KustoPool create(Context context) { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .createOrUpdate( workspaceName, resourceGroupName, @@ -190,7 +190,7 @@ public KustoPool apply() { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .update(workspaceName, resourceGroupName, kustoPoolName, updateParameters, updateIfMatch, Context.NONE); return this; } @@ -199,7 +199,7 @@ public KustoPool apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .update(workspaceName, resourceGroupName, kustoPoolName, updateParameters, updateIfMatch, context); return this; } @@ -216,7 +216,7 @@ public KustoPool refresh() { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .getWithResponse(workspaceName, kustoPoolName, resourceGroupName, Context.NONE) .getValue(); return this; @@ -226,86 +226,82 @@ public KustoPool refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getKustoPoolsOperations() + .getKustoPools() .getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context) .getValue(); return this; } public void stop() { - serviceManager.kustoPoolsOperations().stop(workspaceName, kustoPoolName, resourceGroupName); + serviceManager.kustoPools().stop(workspaceName, kustoPoolName, resourceGroupName); } public void stop(Context context) { - serviceManager.kustoPoolsOperations().stop(workspaceName, kustoPoolName, resourceGroupName, context); + serviceManager.kustoPools().stop(workspaceName, kustoPoolName, resourceGroupName, context); } public void start() { - serviceManager.kustoPoolsOperations().start(workspaceName, kustoPoolName, resourceGroupName); + serviceManager.kustoPools().start(workspaceName, kustoPoolName, resourceGroupName); } public void start(Context context) { - serviceManager.kustoPoolsOperations().start(workspaceName, kustoPoolName, resourceGroupName, context); + serviceManager.kustoPools().start(workspaceName, kustoPoolName, resourceGroupName, context); } public PagedIterable listLanguageExtensions() { - return serviceManager - .kustoPoolsOperations() - .listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName); + return serviceManager.kustoPools().listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName); } public PagedIterable listLanguageExtensions(Context context) { return serviceManager - .kustoPoolsOperations() + .kustoPools() .listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, context); } public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd) { serviceManager - .kustoPoolsOperations() + .kustoPools() .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); } public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd, Context context) { serviceManager - .kustoPoolsOperations() + .kustoPools() .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); } public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove) { serviceManager - .kustoPoolsOperations() + .kustoPools() .removeLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); } public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove, Context context) { serviceManager - .kustoPoolsOperations() + .kustoPools() .removeLanguageExtensions( workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); } public PagedIterable listFollowerDatabases() { - return serviceManager - .kustoPoolsOperations() - .listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName); + return serviceManager.kustoPools().listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName); } public PagedIterable listFollowerDatabases(Context context) { return serviceManager - .kustoPoolsOperations() + .kustoPools() .listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, context); } public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove) { serviceManager - .kustoPoolsOperations() + .kustoPools() .detachFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); } public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove, Context context) { serviceManager - .kustoPoolsOperations() + .kustoPools() .detachFollowerDatabases( workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java index 3828716591b0..3d0f22e73aab 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java @@ -4,13 +4,18 @@ package com.azure.resourcemanager.synapse.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; @@ -23,12 +28,28 @@ 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.synapse.fluent.KustoPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.FollowerDatabaseListResult; +import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; +import com.azure.resourcemanager.synapse.models.KustoPoolUpdate; +import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; +import com.azure.resourcemanager.synapse.models.ListResourceSkusResult; import com.azure.resourcemanager.synapse.models.SkuDescriptionList; +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 KustoPoolsClient. */ @@ -69,6 +90,236 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/locations/{location}" + + "/kustoPoolCheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") KustoPoolCheckNameRequest kustoPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kustoPoolName") String kustoPoolName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") KustoPoolInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kustoPoolName") String kustoPoolName, + @HeaderParam("If-Match") String ifMatch, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") KustoPoolUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkusByResource( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/listLanguageExtensions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/addLanguageExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LanguageExtensionsList languageExtensionsToAdd, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/removeLanguageExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> removeLanguageExtensions( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LanguageExtensionsList languageExtensionsToRemove, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/listFollowerDatabases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listFollowerDatabases( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/detachFollowerDatabases") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detachFollowerDatabases( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FollowerDatabaseDefinitionInner followerDatabaseToRemove, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -191,4 +442,3604 @@ public PagedIterable list() { public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, KustoPoolCheckNameRequest kustoPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } else { + kustoPoolName.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + kustoPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } else { + kustoPoolName.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + apiVersion, + kustoPoolName, + accept, + context); + } + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, KustoPoolCheckNameRequest kustoPoolName) { + return checkNameAvailabilityWithResponseAsync(location, kustoPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName) { + return checkNameAvailabilityAsync(location, kustoPoolName).block(); + } + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { + return checkNameAvailabilityWithResponseAsync(location, kustoPoolName, context).block(); + } + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + apiVersion, + resourceGroupName, + this.client.getSubscriptionId(), + workspaceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + apiVersion, + resourceGroupName, + this.client.getSubscriptionId(), + workspaceName, + accept, + context); + } + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceAsync(resourceGroupName, workspaceName).block(); + } + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context); + } + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { + return getWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner get(String workspaceName, String kustoPoolName, String resourceGroupName) { + return getAsync(workspaceName, kustoPoolName, resourceGroupName).block(); + } + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return getWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + ifNoneMatch, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + ifNoneMatch, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KustoPoolInner> beginCreateOrUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, Context.NONE); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KustoPoolInner> beginCreateOrUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, context); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KustoPoolInner> beginCreateOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) + .getSyncPoller(); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KustoPoolInner> beginCreateOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) + .getSyncPoller(); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner createOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch) { + return createOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner createOrUpdate( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Create or update a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto + * Pool. Other values will result in a 412 Pre-condition Failed response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner createOrUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolInner parameters, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateAsync( + workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) + .block(); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + this.client.getSubscriptionId(), + apiVersion, + parameters, + accept, + context); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KustoPoolInner> beginUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch) { + Mono>> mono = + updateWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, Context.NONE); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KustoPoolInner> beginUpdateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, context); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KustoPoolInner> beginUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch) { + return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).getSyncPoller(); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KustoPoolInner> beginUpdate( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context) { + return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context) + .getSyncPoller(); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch) { + return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters) { + final String ifMatch = null; + return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context) { + return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner update( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch) { + return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).block(); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner update( + String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters) { + final String ifMatch = null; + return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).block(); + } + + /** + * Update a Kusto Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param parameters The Kusto pool parameters supplied to the Update operation. + * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a Kusto kusto pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KustoPoolInner update( + String workspaceName, + String resourceGroupName, + String kustoPoolName, + KustoPoolUpdate parameters, + String ifMatch, + Context context) { + return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context).block(); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required 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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required 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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + this.client.getSubscriptionId(), + apiVersion, + accept, + context); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String workspaceName, String resourceGroupName, String kustoPoolName) { + Mono>> mono = + deleteWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String workspaceName, String resourceGroupName, String kustoPoolName) { + return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName).getSyncPoller(); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName, context).getSyncPoller(); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName) { + return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceName, String resourceGroupName, String kustoPoolName) { + deleteAsync(workspaceName, resourceGroupName, kustoPoolName).block(); + } + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + deleteAsync(workspaceName, resourceGroupName, kustoPoolName, context).block(); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + Mono>> mono = stopWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName).getSyncPoller(); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { + return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String workspaceName, String kustoPoolName, String resourceGroupName) { + stopAsync(workspaceName, kustoPoolName, resourceGroupName).block(); + } + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + stopAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + Mono>> mono = startWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName).getSyncPoller(); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { + return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String workspaceName, String kustoPoolName, String resourceGroupName) { + startAsync(workspaceName, kustoPoolName, resourceGroupName).block(); + } + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + startAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusByResourceSinglePageAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkusByResource( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusByResourceSinglePageAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkusByResource( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusByResourceAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSkusByResourceSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusByResourceAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSkusByResourceSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedIterable<>(listSkusByResourceAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedIterable<>(listSkusByResourceAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLanguageExtensionsSinglePageAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLanguageExtensionsSinglePageAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLanguageExtensionsAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedFlux<>( + () -> listLanguageExtensionsSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLanguageExtensionsAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listLanguageExtensionsSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedIterable<>(listLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedIterable<>( + listLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (languageExtensionsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); + } else { + languageExtensionsToAdd.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .addLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + languageExtensionsToAdd, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (languageExtensionsToAdd == null) { + return Mono + .error( + new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); + } else { + languageExtensionsToAdd.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .addLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + languageExtensionsToAdd, + accept, + context); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAddLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + Mono>> mono = + addLanguageExtensionsWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAddLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + addLanguageExtensionsWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + return beginAddLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd) + .getSyncPoller(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAddLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + return beginAddLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) + .getSyncPoller(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + return beginAddLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + return beginAddLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + addLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd).block(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + addLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) + .block(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (languageExtensionsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter languageExtensionsToRemove is required and cannot be null.")); + } else { + languageExtensionsToRemove.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removeLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + languageExtensionsToRemove, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (languageExtensionsToRemove == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter languageExtensionsToRemove is required and cannot be null.")); + } else { + languageExtensionsToRemove.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removeLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + languageExtensionsToRemove, + accept, + context); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRemoveLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + Mono>> mono = + removeLanguageExtensionsWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRemoveLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + removeLanguageExtensionsWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRemoveLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + return beginRemoveLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) + .getSyncPoller(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRemoveLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + return beginRemoveLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) + .getSyncPoller(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 removeLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + return beginRemoveLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 removeLanguageExtensionsAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + return beginRemoveLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + removeLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) + .block(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + removeLanguageExtensionsAsync( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) + .block(); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listFollowerDatabasesSinglePageAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listFollowerDatabasesSinglePageAsync( + String workspaceName, String kustoPoolName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.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 apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listFollowerDatabasesAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedFlux<>( + () -> listFollowerDatabasesSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listFollowerDatabasesAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listFollowerDatabasesSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedIterable<>(listFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedIterable<>( + listFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (followerDatabaseToRemove == null) { + return Mono + .error( + new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); + } else { + followerDatabaseToRemove.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + followerDatabaseToRemove, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (kustoPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (followerDatabaseToRemove == null) { + return Mono + .error( + new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); + } else { + followerDatabaseToRemove.validate(); + } + final String apiVersion = "2021-06-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + followerDatabaseToRemove, + accept, + context); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDetachFollowerDatabasesAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + Mono>> mono = + detachFollowerDatabasesWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDetachFollowerDatabasesAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + detachFollowerDatabasesWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDetachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove) + .getSyncPoller(); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDetachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + return beginDetachFollowerDatabasesAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) + .getSyncPoller(); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFollowerDatabasesAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFollowerDatabasesAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + return beginDetachFollowerDatabasesAsync( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + detachFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove).block(); + } + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + detachFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) + .block(); + } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsImpl.java index a463cb6105ca..494240375fc2 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsImpl.java @@ -5,11 +5,27 @@ package com.azure.resourcemanager.synapse.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.synapse.fluent.KustoPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.AzureResourceSku; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.FollowerDatabaseDefinition; +import com.azure.resourcemanager.synapse.models.KustoPool; +import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; +import com.azure.resourcemanager.synapse.models.KustoPoolListResult; import com.azure.resourcemanager.synapse.models.KustoPools; +import com.azure.resourcemanager.synapse.models.LanguageExtension; +import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; import com.azure.resourcemanager.synapse.models.SkuDescription; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -36,6 +52,313 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new SkuDescriptionImpl(inner1, this.manager())); } + public CheckNameResult checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName) { + CheckNameResultInner inner = this.serviceClient().checkNameAvailability(location, kustoPoolName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, kustoPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KustoPoolListResult listByWorkspace(String resourceGroupName, String workspaceName) { + KustoPoolListResultInner inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + if (inner != null) { + return new KustoPoolListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().listByWorkspaceWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KustoPoolListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KustoPool get(String workspaceName, String kustoPoolName, String resourceGroupName) { + KustoPoolInner inner = this.serviceClient().get(workspaceName, kustoPoolName, resourceGroupName); + if (inner != null) { + return new KustoPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KustoPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String workspaceName, String resourceGroupName, String kustoPoolName) { + this.serviceClient().delete(workspaceName, resourceGroupName, kustoPoolName); + } + + public void delete(String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { + this.serviceClient().delete(workspaceName, resourceGroupName, kustoPoolName, context); + } + + public void stop(String workspaceName, String kustoPoolName, String resourceGroupName) { + this.serviceClient().stop(workspaceName, kustoPoolName, resourceGroupName); + } + + public void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + this.serviceClient().stop(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public void start(String workspaceName, String kustoPoolName, String resourceGroupName) { + this.serviceClient().start(workspaceName, kustoPoolName, resourceGroupName); + } + + public void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + this.serviceClient().start(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listSkusByResource(workspaceName, kustoPoolName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listSkusByResource(workspaceName, kustoPoolName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new LanguageExtensionImpl(inner1, this.manager())); + } + + public PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new LanguageExtensionImpl(inner1, this.manager())); + } + + public void addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd) { + this + .serviceClient() + .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); + } + + public void addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context) { + this + .serviceClient() + .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); + } + + public void removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove) { + this + .serviceClient() + .removeLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); + } + + public void removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context) { + this + .serviceClient() + .removeLanguageExtensions( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); + } + + public PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); + } + + public void detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + this + .serviceClient() + .detachFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); + } + + public void detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context) { + this + .serviceClient() + .detachFollowerDatabases( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); + } + + public KustoPool getById(String id) { + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); + if (kustoPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", 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))); + } + return this.getWithResponse(workspaceName, kustoPoolName, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); + if (kustoPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", 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))); + } + return this.getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public void deleteById(String id) { + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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 kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); + if (kustoPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", id))); + } + this.delete(workspaceName, resourceGroupName, kustoPoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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 kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); + if (kustoPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", id))); + } + this.delete(workspaceName, resourceGroupName, kustoPoolName, context); + } + private KustoPoolsClient serviceClient() { return this.innerClient; } @@ -43,4 +366,8 @@ private KustoPoolsClient serviceClient() { private com.azure.resourcemanager.synapse.SynapseManager manager() { return this.serviceManager; } + + public KustoPoolImpl define(String name) { + return new KustoPoolImpl(name, this.manager()); + } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsClientImpl.java deleted file mode 100644 index 1b6ee368874a..000000000000 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsClientImpl.java +++ /dev/null @@ -1,3912 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.synapse.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.synapse.fluent.KustoPoolsOperationsClient; -import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; -import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; -import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; -import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.synapse.models.FollowerDatabaseListResult; -import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; -import com.azure.resourcemanager.synapse.models.KustoPoolUpdate; -import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; -import com.azure.resourcemanager.synapse.models.ListResourceSkusResult; -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 KustoPoolsOperationsClient. */ -public final class KustoPoolsOperationsClientImpl implements KustoPoolsOperationsClient { - private final ClientLogger logger = new ClientLogger(KustoPoolsOperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final KustoPoolsOperationsService service; - - /** The service client containing this operation class. */ - private final SynapseManagementClientImpl client; - - /** - * Initializes an instance of KustoPoolsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - KustoPoolsOperationsClientImpl(SynapseManagementClientImpl client) { - this.service = - RestProxy - .create(KustoPoolsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SynapseManagementClientKustoPoolsOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SynapseManagementCli") - private interface KustoPoolsOperationsService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/locations/{location}" - + "/kustoPoolCheckNameAvailability") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KustoPoolCheckNameRequest kustoPoolName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("kustoPoolName") String kustoPoolName, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KustoPoolInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("kustoPoolName") String kustoPoolName, - @HeaderParam("If-Match") String ifMatch, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") KustoPoolUpdate parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/skus") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkusByResource( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/listLanguageExtensions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLanguageExtensions( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/addLanguageExtensions") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> addLanguageExtensions( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LanguageExtensionsList languageExtensionsToAdd, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/removeLanguageExtensions") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> removeLanguageExtensions( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LanguageExtensionsList languageExtensionsToRemove, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/listFollowerDatabases") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listFollowerDatabases( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" - + "/{workspaceName}/kustoPools/{kustoPoolName}/detachFollowerDatabases") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> detachFollowerDatabases( - @HostParam("$host") String endpoint, - @PathParam("workspaceName") String workspaceName, - @PathParam("kustoPoolName") String kustoPoolName, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FollowerDatabaseDefinitionInner followerDatabaseToRemove, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String location, KustoPoolCheckNameRequest kustoPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } else { - kustoPoolName.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - apiVersion, - kustoPoolName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } else { - kustoPoolName.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - apiVersion, - kustoPoolName, - accept, - context); - } - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync( - String location, KustoPoolCheckNameRequest kustoPoolName) { - return checkNameAvailabilityWithResponseAsync(location, kustoPoolName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameResultInner checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName) { - return checkNameAvailabilityAsync(location, kustoPoolName).block(); - } - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { - return checkNameAvailabilityWithResponseAsync(location, kustoPoolName, context).block(); - } - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByWorkspace( - this.client.getEndpoint(), - apiVersion, - resourceGroupName, - this.client.getSubscriptionId(), - workspaceName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace( - this.client.getEndpoint(), - apiVersion, - resourceGroupName, - this.client.getSubscriptionId(), - workspaceName, - accept, - context); - } - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { - return listByWorkspaceAsync(resourceGroupName, workspaceName).block(); - } - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); - } - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context); - } - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { - return getWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner get(String workspaceName, String kustoPoolName, String resourceGroupName) { - return getAsync(workspaceName, kustoPoolName, resourceGroupName).block(); - } - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return getWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - ifMatch, - ifNoneMatch, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - ifMatch, - ifNoneMatch, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, KustoPoolInner> beginCreateOrUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch) { - Mono>> mono = - createOrUpdateWithResponseAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, Context.NONE); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, KustoPoolInner> beginCreateOrUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, context); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, KustoPoolInner> beginCreateOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch) { - return beginCreateOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) - .getSyncPoller(); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, KustoPoolInner> beginCreateOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - return beginCreateOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) - .getSyncPoller(); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch) { - return beginCreateOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return beginCreateOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - return beginCreateOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner createOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch) { - return createOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) - .block(); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner createOrUpdate( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters) { - final String ifMatch = null; - final String ifNoneMatch = null; - return createOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch) - .block(); - } - - /** - * Create or update a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto - * Pool. Other values will result in a 412 Pre-condition Failed response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner createOrUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolInner parameters, - String ifMatch, - String ifNoneMatch, - Context context) { - return createOrUpdateAsync( - workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) - .block(); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - ifMatch, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - ifMatch, - this.client.getSubscriptionId(), - apiVersion, - parameters, - accept, - context); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, KustoPoolInner> beginUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch) { - Mono>> mono = - updateWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, Context.NONE); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, KustoPoolInner> beginUpdateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), KustoPoolInner.class, KustoPoolInner.class, context); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, KustoPoolInner> beginUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch) { - return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).getSyncPoller(); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, KustoPoolInner> beginUpdate( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context) { - return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context) - .getSyncPoller(); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch) { - return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters) { - final String ifMatch = null; - return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context) { - return beginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner update( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch) { - return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).block(); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner update( - String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolUpdate parameters) { - final String ifMatch = null; - return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).block(); - } - - /** - * Update a Kusto Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param parameters The Kusto pool parameters supplied to the Update operation. - * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify - * the last-seen ETag value to prevent accidentally overwriting concurrent changes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class representing a Kusto kusto pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KustoPoolInner update( - String workspaceName, - String resourceGroupName, - String kustoPoolName, - KustoPoolUpdate parameters, - String ifMatch, - Context context) { - return updateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, context).block(); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required 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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required 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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - workspaceName, - resourceGroupName, - kustoPoolName, - this.client.getSubscriptionId(), - apiVersion, - accept, - context); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String workspaceName, String resourceGroupName, String kustoPoolName) { - Mono>> mono = - deleteWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(workspaceName, resourceGroupName, kustoPoolName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String workspaceName, String resourceGroupName, String kustoPoolName) { - return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName).getSyncPoller(); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName, context).getSyncPoller(); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName) { - return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - return beginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 workspaceName, String resourceGroupName, String kustoPoolName) { - deleteAsync(workspaceName, resourceGroupName, kustoPoolName).block(); - } - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - deleteAsync(workspaceName, resourceGroupName, kustoPoolName, context).block(); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - Mono>> mono = stopWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName).getSyncPoller(); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { - return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return beginStopAsync(workspaceName, kustoPoolName, resourceGroupName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String workspaceName, String kustoPoolName, String resourceGroupName) { - stopAsync(workspaceName, kustoPoolName, resourceGroupName).block(); - } - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - stopAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - Mono>> mono = startWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - startWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName).getSyncPoller(); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName, context).getSyncPoller(); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String workspaceName, String kustoPoolName, String resourceGroupName) { - return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return beginStartAsync(workspaceName, kustoPoolName, resourceGroupName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String workspaceName, String kustoPoolName, String resourceGroupName) { - startAsync(workspaceName, kustoPoolName, resourceGroupName).block(); - } - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - startAsync(workspaceName, kustoPoolName, resourceGroupName, context).block(); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusByResourceSinglePageAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSkusByResource( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusByResourceSinglePageAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSkusByResource( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusByResourceAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedFlux<>( - () -> listSkusByResourceSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusByResourceAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listSkusByResourceSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedIterable<>(listSkusByResourceAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedIterable<>(listSkusByResourceAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLanguageExtensionsSinglePageAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLanguageExtensionsSinglePageAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLanguageExtensionsAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedFlux<>( - () -> listLanguageExtensionsSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLanguageExtensionsAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listLanguageExtensionsSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedIterable<>(listLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedIterable<>( - listLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (languageExtensionsToAdd == null) { - return Mono - .error( - new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); - } else { - languageExtensionsToAdd.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .addLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - languageExtensionsToAdd, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> addLanguageExtensionsWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (languageExtensionsToAdd == null) { - return Mono - .error( - new IllegalArgumentException("Parameter languageExtensionsToAdd is required and cannot be null.")); - } else { - languageExtensionsToAdd.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .addLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - languageExtensionsToAdd, - accept, - context); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginAddLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - Mono>> mono = - addLanguageExtensionsWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginAddLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - addLanguageExtensionsWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginAddLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - return beginAddLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd) - .getSyncPoller(); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginAddLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - return beginAddLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) - .getSyncPoller(); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - return beginAddLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 addLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - return beginAddLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - addLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd).block(); - } - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - addLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context) - .block(); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (languageExtensionsToRemove == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter languageExtensionsToRemove is required and cannot be null.")); - } else { - languageExtensionsToRemove.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .removeLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - languageExtensionsToRemove, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> removeLanguageExtensionsWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (languageExtensionsToRemove == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter languageExtensionsToRemove is required and cannot be null.")); - } else { - languageExtensionsToRemove.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .removeLanguageExtensions( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - languageExtensionsToRemove, - accept, - context); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRemoveLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - Mono>> mono = - removeLanguageExtensionsWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRemoveLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - removeLanguageExtensionsWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRemoveLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - return beginRemoveLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) - .getSyncPoller(); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRemoveLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - return beginRemoveLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) - .getSyncPoller(); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 removeLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - return beginRemoveLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 removeLanguageExtensionsAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - return beginRemoveLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - removeLanguageExtensionsAsync(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove) - .block(); - } - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - removeLanguageExtensionsAsync( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context) - .block(); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFollowerDatabasesSinglePageAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listFollowerDatabases( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFollowerDatabasesSinglePageAsync( - String workspaceName, String kustoPoolName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listFollowerDatabases( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listFollowerDatabasesAsync( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedFlux<>( - () -> listFollowerDatabasesSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listFollowerDatabasesAsync( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listFollowerDatabasesSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName) { - return new PagedIterable<>(listFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName)); - } - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - return new PagedIterable<>( - listFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, context)); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (followerDatabaseToRemove == null) { - return Mono - .error( - new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); - } else { - followerDatabaseToRemove.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .detachFollowerDatabases( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - followerDatabaseToRemove, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> detachFollowerDatabasesWithResponseAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (kustoPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter kustoPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (followerDatabaseToRemove == null) { - return Mono - .error( - new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null.")); - } else { - followerDatabaseToRemove.validate(); - } - final String apiVersion = "2021-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .detachFollowerDatabases( - this.client.getEndpoint(), - workspaceName, - kustoPoolName, - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - followerDatabaseToRemove, - accept, - context); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDetachFollowerDatabasesAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - Mono>> mono = - detachFollowerDatabasesWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDetachFollowerDatabasesAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - detachFollowerDatabasesWithResponseAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDetachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - return beginDetachFollowerDatabasesAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove) - .getSyncPoller(); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDetachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - return beginDetachFollowerDatabasesAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) - .getSyncPoller(); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 detachFollowerDatabasesAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - return beginDetachFollowerDatabasesAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 detachFollowerDatabasesAsync( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - return beginDetachFollowerDatabasesAsync( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - detachFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove).block(); - } - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - detachFollowerDatabasesAsync(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context) - .block(); - } -} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsImpl.java deleted file mode 100644 index ff0708169180..000000000000 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsImpl.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.synapse.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.synapse.fluent.KustoPoolsOperationsClient; -import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; -import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; -import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; -import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; -import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; -import com.azure.resourcemanager.synapse.models.AzureResourceSku; -import com.azure.resourcemanager.synapse.models.CheckNameResult; -import com.azure.resourcemanager.synapse.models.FollowerDatabaseDefinition; -import com.azure.resourcemanager.synapse.models.KustoPool; -import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; -import com.azure.resourcemanager.synapse.models.KustoPoolListResult; -import com.azure.resourcemanager.synapse.models.KustoPoolsOperations; -import com.azure.resourcemanager.synapse.models.LanguageExtension; -import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class KustoPoolsOperationsImpl implements KustoPoolsOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolsOperationsImpl.class); - - private final KustoPoolsOperationsClient innerClient; - - private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; - - public KustoPoolsOperationsImpl( - KustoPoolsOperationsClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public CheckNameResult checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName) { - CheckNameResultInner inner = this.serviceClient().checkNameAvailability(location, kustoPoolName); - if (inner != null) { - return new CheckNameResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response checkNameAvailabilityWithResponse( - String location, KustoPoolCheckNameRequest kustoPoolName, Context context) { - Response inner = - this.serviceClient().checkNameAvailabilityWithResponse(location, kustoPoolName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CheckNameResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public KustoPoolListResult listByWorkspace(String resourceGroupName, String workspaceName) { - KustoPoolListResultInner inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); - if (inner != null) { - return new KustoPoolListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().listByWorkspaceWithResponse(resourceGroupName, workspaceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new KustoPoolListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public KustoPool get(String workspaceName, String kustoPoolName, String resourceGroupName) { - KustoPoolInner inner = this.serviceClient().get(workspaceName, kustoPoolName, resourceGroupName); - if (inner != null) { - return new KustoPoolImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new KustoPoolImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String workspaceName, String resourceGroupName, String kustoPoolName) { - this.serviceClient().delete(workspaceName, resourceGroupName, kustoPoolName); - } - - public void delete(String workspaceName, String resourceGroupName, String kustoPoolName, Context context) { - this.serviceClient().delete(workspaceName, resourceGroupName, kustoPoolName, context); - } - - public void stop(String workspaceName, String kustoPoolName, String resourceGroupName) { - this.serviceClient().stop(workspaceName, kustoPoolName, resourceGroupName); - } - - public void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - this.serviceClient().stop(workspaceName, kustoPoolName, resourceGroupName, context); - } - - public void start(String workspaceName, String kustoPoolName, String resourceGroupName) { - this.serviceClient().start(workspaceName, kustoPoolName, resourceGroupName); - } - - public void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - this.serviceClient().start(workspaceName, kustoPoolName, resourceGroupName, context); - } - - public PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listSkusByResource(workspaceName, kustoPoolName, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); - } - - public PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listSkusByResource(workspaceName, kustoPoolName, resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); - } - - public PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LanguageExtensionImpl(inner1, this.manager())); - } - - public PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new LanguageExtensionImpl(inner1, this.manager())); - } - - public void addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd) { - this - .serviceClient() - .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); - } - - public void addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context) { - this - .serviceClient() - .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); - } - - public void removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove) { - this - .serviceClient() - .removeLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); - } - - public void removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context) { - this - .serviceClient() - .removeLanguageExtensions( - workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); - } - - public PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); - } - - public PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new FollowerDatabaseDefinitionImpl(inner1, this.manager())); - } - - public void detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove) { - this - .serviceClient() - .detachFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); - } - - public void detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context) { - this - .serviceClient() - .detachFollowerDatabases( - workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); - } - - public KustoPool getById(String id) { - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); - if (kustoPoolName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", 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))); - } - return this.getWithResponse(workspaceName, kustoPoolName, resourceGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); - } - String kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); - if (kustoPoolName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", 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))); - } - return this.getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context); - } - - public void deleteById(String id) { - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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 kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); - if (kustoPoolName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", id))); - } - this.delete(workspaceName, resourceGroupName, kustoPoolName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); - if (workspaceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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 kustoPoolName = Utils.getValueFromIdByName(id, "kustoPools"); - if (kustoPoolName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'kustoPools'.", id))); - } - this.delete(workspaceName, resourceGroupName, kustoPoolName, context); - } - - private KustoPoolsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.synapse.SynapseManager manager() { - return this.serviceManager; - } - - public KustoPoolImpl define(String name) { - return new KustoPoolImpl(name, this.manager()); - } -} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java index 5ee980278f08..91b255319d0b 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java @@ -8,6 +8,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.ResourceMoveDefinition; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.SqlPool; @@ -79,7 +80,7 @@ public OffsetDateTime restorePointInTime() { return this.innerModel().restorePointInTime(); } - public String createMode() { + public CreateMode createMode() { return this.innerModel().createMode(); } @@ -328,7 +329,7 @@ public SqlPoolImpl withRestorePointInTime(OffsetDateTime restorePointInTime) { } } - public SqlPoolImpl withCreateMode(String createMode) { + public SqlPoolImpl withCreateMode(CreateMode createMode) { if (isInCreateMode()) { this.innerModel().withCreateMode(createMode); return this; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java index 6649b70ce080..14312f876e93 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java @@ -45,7 +45,6 @@ import com.azure.resourcemanager.synapse.fluent.KustoPoolDatabasesClient; import com.azure.resourcemanager.synapse.fluent.KustoPoolPrincipalAssignmentsClient; import com.azure.resourcemanager.synapse.fluent.KustoPoolsClient; -import com.azure.resourcemanager.synapse.fluent.KustoPoolsOperationsClient; import com.azure.resourcemanager.synapse.fluent.LibrariesClient; import com.azure.resourcemanager.synapse.fluent.LibrariesOperationsClient; import com.azure.resourcemanager.synapse.fluent.OperationsClient; @@ -966,18 +965,6 @@ public KustoPoolsClient getKustoPools() { return this.kustoPools; } - /** The KustoPoolsOperationsClient object to access its operations. */ - private final KustoPoolsOperationsClient kustoPoolsOperations; - - /** - * Gets the KustoPoolsOperationsClient object to access its operations. - * - * @return the KustoPoolsOperationsClient object. - */ - public KustoPoolsOperationsClient getKustoPoolsOperations() { - return this.kustoPoolsOperations; - } - /** The KustoPoolChildResourcesClient object to access its operations. */ private final KustoPoolChildResourcesClient kustoPoolChildResources; @@ -1146,7 +1133,6 @@ public KustoPoolDatabasePrincipalAssignmentsClient getKustoPoolDatabasePrincipal this.sparkConfigurationsOperations = new SparkConfigurationsOperationsClientImpl(this); this.kustoOperations = new KustoOperationsClientImpl(this); this.kustoPools = new KustoPoolsClientImpl(this); - this.kustoPoolsOperations = new KustoPoolsOperationsClientImpl(this); this.kustoPoolChildResources = new KustoPoolChildResourcesClientImpl(this); this.kustoPoolAttachedDatabaseConfigurations = new KustoPoolAttachedDatabaseConfigurationsClientImpl(this); this.kustoPoolDatabases = new KustoPoolDatabasesClientImpl(this); diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateMode.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateMode.java new file mode 100644 index 000000000000..f766fbbd159b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateMode.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreateMode. */ +public final class CreateMode extends ExpandableStringEnum { + /** Static value Default for CreateMode. */ + public static final CreateMode DEFAULT = fromString("Default"); + + /** Static value PointInTimeRestore for CreateMode. */ + public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + + /** Static value Recovery for CreateMode. */ + public static final CreateMode RECOVERY = fromString("Recovery"); + + /** Static value Restore for CreateMode. */ + public static final CreateMode RESTORE = fromString("Restore"); + + /** + * Creates or finds a CreateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreateMode. + */ + @JsonCreator + public static CreateMode fromString(String name) { + return fromString(name, CreateMode.class); + } + + /** @return known CreateMode values. */ + public static Collection values() { + return values(CreateMode.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataConnection.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataConnection.java index 571c8baf7592..5df7b56912b1 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataConnection.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataConnection.java @@ -219,6 +219,31 @@ public ResourceProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the managedIdentityResourceId property: The resource ID of a managed identity (system or user assigned) to be + * used to authenticate with event hub. + * + * @return the managedIdentityResourceId value. + */ + public String managedIdentityResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().managedIdentityResourceId(); + } + + /** + * Set the managedIdentityResourceId property: The resource ID of a managed identity (system or user assigned) to be + * used to authenticate with event hub. + * + * @param managedIdentityResourceId the managedIdentityResourceId value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withManagedIdentityResourceId(String managedIdentityResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new EventHubConnectionProperties(); + } + this.innerProperties().withManagedIdentityResourceId(managedIdentityResourceId); + return this; + } + /** * Validates the instance. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPools.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPools.java index 8824d53d311e..77cf20ff9ec1 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPools.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPools.java @@ -5,7 +5,9 @@ package com.azure.resourcemanager.synapse.models; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; /** Resource collection API of KustoPools. */ public interface KustoPools { @@ -28,4 +30,406 @@ public interface KustoPools { * @return the list of the SKU descriptions. */ PagedIterable list(Context context); + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName); + + /** + * Checks that the kusto pool name is valid and is not already in use. + * + * @param location The name of Azure region. + * @param kustoPoolName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String location, KustoPoolCheckNameRequest kustoPoolName, Context context); + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + KustoPoolListResult listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all Kusto pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto pools operation response. + */ + Response listByWorkspaceWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + KustoPool get(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Gets a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + Response getWithResponse( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName); + + /** + * Deletes a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param kustoPoolName The name of the Kusto pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName, Context context); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Stops a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Starts a Kusto pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns the SKUs available for the provided resource. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of available SKUs for a Kusto Pool. + */ + PagedIterable listSkusByResource( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of language extension objects. + */ + PagedIterable listLanguageExtensions( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToAdd The language extensions to add. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 addLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToAdd, + Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param languageExtensionsToRemove The language extensions to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 removeLanguageExtensions( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + LanguageExtensionsList languageExtensionsToRemove, + Context context); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list Kusto database principals operation response. + */ + PagedIterable listFollowerDatabases( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFollowerDatabases( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + FollowerDatabaseDefinitionInner followerDatabaseToRemove, + Context context); + + /** + * Gets a Kusto pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + KustoPool getById(String id); + + /** + * Gets a Kusto pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Kusto pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto pool. + * + * @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 Kusto pool. + * + * @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 KustoPool resource. + * + * @param name resource name. + * @return the first stage of the new KustoPool definition. + */ + KustoPool.DefinitionStages.Blank define(String name); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolsOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolsOperations.java deleted file mode 100644 index c261f6932798..000000000000 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolsOperations.java +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.synapse.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; - -/** Resource collection API of KustoPoolsOperations. */ -public interface KustoPoolsOperations { - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - CheckNameResult checkNameAvailability(String location, KustoPoolCheckNameRequest kustoPoolName); - - /** - * Checks that the kusto pool name is valid and is not already in use. - * - * @param location The name of Azure region. - * @param kustoPoolName The name of the cluster. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. - */ - Response checkNameAvailabilityWithResponse( - String location, KustoPoolCheckNameRequest kustoPoolName, Context context); - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - KustoPoolListResult listByWorkspace(String resourceGroupName, String workspaceName); - - /** - * List all Kusto pools. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto pools operation response. - */ - Response listByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, Context context); - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - KustoPool get(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Gets a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - Response getWithResponse( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName); - - /** - * Deletes a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param kustoPoolName The name of the Kusto pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 workspaceName, String resourceGroupName, String kustoPoolName, Context context); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Stops a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Starts a Kusto pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns the SKUs available for the provided resource. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs for a Kusto Pool. - */ - PagedIterable listSkusByResource( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of language extension objects. - */ - PagedIterable listLanguageExtensions( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd); - - /** - * Add a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToAdd The language extensions to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 addLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToAdd, - Context context); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove); - - /** - * Remove a list of language extensions that can run within KQL queries. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param languageExtensionsToRemove The language extensions to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 removeLanguageExtensions( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - LanguageExtensionsList languageExtensionsToRemove, - Context context); - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName); - - /** - * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list Kusto database principals operation response. - */ - PagedIterable listFollowerDatabases( - String workspaceName, String kustoPoolName, String resourceGroupName, Context context); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove); - - /** - * Detaches all followers of a database owned by this Kusto Pool. - * - * @param workspaceName The name of the workspace. - * @param kustoPoolName The name of the Kusto pool. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param followerDatabaseToRemove The follower databases properties to remove. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 detachFollowerDatabases( - String workspaceName, - String kustoPoolName, - String resourceGroupName, - FollowerDatabaseDefinitionInner followerDatabaseToRemove, - Context context); - - /** - * Gets a Kusto pool. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - KustoPool getById(String id); - - /** - * Gets a Kusto pool. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Kusto pool. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a Kusto pool. - * - * @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 Kusto pool. - * - * @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 KustoPool resource. - * - * @param name resource name. - * @return the first stage of the new KustoPool definition. - */ - KustoPool.DefinitionStages.Blank define(String name); -} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java index 21a9b6932c81..f2b2f902c63b 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java @@ -105,11 +105,23 @@ public interface SqlPool { OffsetDateTime restorePointInTime(); /** - * Gets the createMode property: What is this?. + * Gets the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @return the createMode value. */ - String createMode(); + CreateMode createMode(); /** * Gets the creationDate property: Date the SQL pool was created. @@ -320,12 +332,33 @@ interface WithRestorePointInTime { /** The stage of the SqlPool definition allowing to specify createMode. */ interface WithCreateMode { /** - * Specifies the createMode property: What is this?. + * Specifies the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime + * must be specified. * - * @param createMode What is this?. + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be + * the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified.. + * + * @param createMode Specifies the mode of sql pool creation. + *

Default: regular sql pool creation. + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql + * pool. sourceDatabaseId must be specified as the resource ID of the existing sql pool, and + * restorePointInTime must be specified. + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should + * be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be + * specified. * @return the next definition stage. */ - WithCreate withCreateMode(String createMode); + WithCreate withCreateMode(CreateMode createMode); } /** The stage of the SqlPool definition allowing to specify creationDate. */ interface WithCreationDate { @@ -491,12 +524,33 @@ interface WithRestorePointInTime { /** The stage of the SqlPool update allowing to specify createMode. */ interface WithCreateMode { /** - * Specifies the createMode property: What is this?. + * Specifies the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime + * must be specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be + * the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified.. * - * @param createMode What is this?. + * @param createMode Specifies the mode of sql pool creation. + *

Default: regular sql pool creation. + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql + * pool. sourceDatabaseId must be specified as the resource ID of the existing sql pool, and + * restorePointInTime must be specified. + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should + * be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be + * specified. * @return the next definition stage. */ - Update withCreateMode(String createMode); + Update withCreateMode(CreateMode createMode); } /** The stage of the SqlPool update allowing to specify creationDate. */ interface WithCreationDate { diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java index 7d7642524a5e..b8d3fa720134 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java @@ -274,21 +274,45 @@ public SqlPoolPatchInfo withRestorePointInTime(OffsetDateTime restorePointInTime } /** - * Get the createMode property: What is this?. + * Get the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @return the createMode value. */ - public String createMode() { + public CreateMode createMode() { return this.innerProperties() == null ? null : this.innerProperties().createMode(); } /** - * Set the createMode property: What is this?. + * Set the createMode property: Specifies the mode of sql pool creation. + * + *

Default: regular sql pool creation. + * + *

PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool. + * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be + * specified. + * + *

Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the + * recoverableDatabaseId to restore. + * + *

Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql + * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. * * @param createMode the createMode value to set. * @return the SqlPoolPatchInfo object itself. */ - public SqlPoolPatchInfo withCreateMode(String createMode) { + public SqlPoolPatchInfo withCreateMode(CreateMode createMode) { if (this.innerProperties() == null) { this.innerProperties = new SqlPoolResourceProperties(); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationAddLanguageExtensionsSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsAddLanguageExtensionsSamples.java similarity index 89% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationAddLanguageExtensionsSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsAddLanguageExtensionsSamples.java index 83c8326ac35f..71cb20de44be 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationAddLanguageExtensionsSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsAddLanguageExtensionsSamples.java @@ -10,8 +10,8 @@ import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; import java.util.Arrays; -/** Samples for KustoPoolsOperation AddLanguageExtensions. */ -public final class KustoPoolsOperationAddLanguageExtensionsSamples { +/** Samples for KustoPools AddLanguageExtensions. */ +public final class KustoPoolsAddLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsAdd.json */ @@ -22,7 +22,7 @@ public final class KustoPoolsOperationAddLanguageExtensionsSamples { */ public static void kustoPoolAddLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .addLanguageExtensions( "kustorptest", "kustoclusterrptest4", diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCheckNameAvailabilitySamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCheckNameAvailabilitySamples.java similarity index 84% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCheckNameAvailabilitySamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCheckNameAvailabilitySamples.java index deeca984d403..748cc3fbcc01 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCheckNameAvailabilitySamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCheckNameAvailabilitySamples.java @@ -7,8 +7,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.models.KustoPoolCheckNameRequest; -/** Samples for KustoPoolsOperation CheckNameAvailability. */ -public final class KustoPoolsOperationCheckNameAvailabilitySamples { +/** Samples for KustoPools CheckNameAvailability. */ +public final class KustoPoolsCheckNameAvailabilitySamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCheckNameAvailability.json */ @@ -19,7 +19,7 @@ public final class KustoPoolsOperationCheckNameAvailabilitySamples { */ public static void kustoPoolsCheckNameAvailability(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .checkNameAvailabilityWithResponse( "westus", new KustoPoolCheckNameRequest().withName("kustoclusterrptest4"), Context.NONE); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCreateOrUpdateSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCreateOrUpdateSamples.java similarity index 88% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCreateOrUpdateSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCreateOrUpdateSamples.java index 4a11c7567db1..909df87a82ee 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationCreateOrUpdateSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsCreateOrUpdateSamples.java @@ -8,8 +8,8 @@ import com.azure.resourcemanager.synapse.models.SkuName; import com.azure.resourcemanager.synapse.models.SkuSize; -/** Samples for KustoPoolsOperation CreateOrUpdate. */ -public final class KustoPoolsOperationCreateOrUpdateSamples { +/** Samples for KustoPools CreateOrUpdate. */ +public final class KustoPoolsCreateOrUpdateSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsCreateOrUpdate.json */ @@ -20,7 +20,7 @@ public final class KustoPoolsOperationCreateOrUpdateSamples { */ public static void kustoPoolsCreateOrUpdate(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .define("kustoclusterrptest4") .withRegion("westus") .withExistingWorkspace("synapseWorkspaceName", "kustorptest") diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDeleteSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDeleteSamples.java similarity index 74% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDeleteSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDeleteSamples.java index b2c6d84766d6..de8139a923f7 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDeleteSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDeleteSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Delete. */ -public final class KustoPoolsOperationDeleteSamples { +/** Samples for KustoPools Delete. */ +public final class KustoPoolsDeleteSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsDelete.json */ @@ -17,6 +17,6 @@ public final class KustoPoolsOperationDeleteSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsDelete(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().delete("kustorptest", "kustorptest", "kustoclusterrptest4", Context.NONE); + manager.kustoPools().delete("kustorptest", "kustorptest", "kustoclusterrptest4", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDetachFollowerDatabasesSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDetachFollowerDatabasesSamples.java similarity index 88% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDetachFollowerDatabasesSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDetachFollowerDatabasesSamples.java index d1ec513faeb1..00401b153c7d 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationDetachFollowerDatabasesSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsDetachFollowerDatabasesSamples.java @@ -7,8 +7,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; -/** Samples for KustoPoolsOperation DetachFollowerDatabases. */ -public final class KustoPoolsOperationDetachFollowerDatabasesSamples { +/** Samples for KustoPools DetachFollowerDatabases. */ +public final class KustoPoolsDetachFollowerDatabasesSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesDetach.json */ @@ -19,7 +19,7 @@ public final class KustoPoolsOperationDetachFollowerDatabasesSamples { */ public static void kustoPoolDetachFollowerDatabases(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .detachFollowerDatabases( "kustorptest", "kustoclusterrptest4", diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationGetSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsGetSamples.java similarity index 84% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationGetSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsGetSamples.java index 32896cbe2b90..a5bbcbe29f50 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationGetSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsGetSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Get. */ -public final class KustoPoolsOperationGetSamples { +/** Samples for KustoPools Get. */ +public final class KustoPoolsGetSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsGet.json */ @@ -18,7 +18,7 @@ public final class KustoPoolsOperationGetSamples { */ public static void kustoPoolsGet(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .getWithResponse("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListByWorkspaceSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListByWorkspaceSamples.java similarity index 74% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListByWorkspaceSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListByWorkspaceSamples.java index 162a9fff5955..a12210cd2398 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListByWorkspaceSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListByWorkspaceSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListByWorkspace. */ -public final class KustoPoolsOperationListByWorkspaceSamples { +/** Samples for KustoPools ListByWorkspace. */ +public final class KustoPoolsListByWorkspaceSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListByWorkspace.json */ @@ -17,6 +17,6 @@ public final class KustoPoolsOperationListByWorkspaceSamples { * @param manager Entry point to SynapseManager. */ public static void listKustoPoolsInAWorkspace(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().listByWorkspaceWithResponse("kustorptest", "kustorptest", Context.NONE); + manager.kustoPools().listByWorkspaceWithResponse("kustorptest", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListFollowerDatabasesSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListFollowerDatabasesSamples.java similarity index 70% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListFollowerDatabasesSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListFollowerDatabasesSamples.java index 06178b7837ce..a74c436e93b3 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListFollowerDatabasesSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListFollowerDatabasesSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListFollowerDatabases. */ -public final class KustoPoolsOperationListFollowerDatabasesSamples { +/** Samples for KustoPools ListFollowerDatabases. */ +public final class KustoPoolsListFollowerDatabasesSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolFollowerDatabasesList.json */ @@ -17,8 +17,6 @@ public final class KustoPoolsOperationListFollowerDatabasesSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolListFollowerDatabases(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager - .kustoPoolsOperations() - .listFollowerDatabases("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().listFollowerDatabases("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListLanguageExtensionsSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListLanguageExtensionsSamples.java similarity index 69% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListLanguageExtensionsSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListLanguageExtensionsSamples.java index 39be0fe0468c..4e111dec4eb5 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListLanguageExtensionsSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListLanguageExtensionsSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListLanguageExtensions. */ -public final class KustoPoolsOperationListLanguageExtensionsSamples { +/** Samples for KustoPools ListLanguageExtensions. */ +public final class KustoPoolsListLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsList.json */ @@ -17,8 +17,6 @@ public final class KustoPoolsOperationListLanguageExtensionsSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolListLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager - .kustoPoolsOperations() - .listLanguageExtensions("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().listLanguageExtensions("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolListSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSamples.java similarity index 89% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolListSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSamples.java index 282ca28811b2..d97f520a4211 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolListSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPool List. */ -public final class KustoPoolListSamples { +/** Samples for KustoPools List. */ +public final class KustoPoolsListSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListSkus.json */ diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListSkusByResourceSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSkusByResourceSamples.java similarity index 82% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListSkusByResourceSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSkusByResourceSamples.java index 2932f934ceec..afe8c13d4f60 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationListSkusByResourceSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsListSkusByResourceSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation ListSkusByResource. */ -public final class KustoPoolsOperationListSkusByResourceSamples { +/** Samples for KustoPools ListSkusByResource. */ +public final class KustoPoolsListSkusByResourceSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsListResourceSkus.json */ @@ -18,7 +18,7 @@ public final class KustoPoolsOperationListSkusByResourceSamples { */ public static void kustoPoolsListResourceSkus(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .listSkusByResource("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationRemoveLanguageExtensionsSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsRemoveLanguageExtensionsSamples.java similarity index 89% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationRemoveLanguageExtensionsSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsRemoveLanguageExtensionsSamples.java index 702543ded6c6..27ba0ccba560 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationRemoveLanguageExtensionsSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsRemoveLanguageExtensionsSamples.java @@ -10,8 +10,8 @@ import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; import java.util.Arrays; -/** Samples for KustoPoolsOperation RemoveLanguageExtensions. */ -public final class KustoPoolsOperationRemoveLanguageExtensionsSamples { +/** Samples for KustoPools RemoveLanguageExtensions. */ +public final class KustoPoolsRemoveLanguageExtensionsSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolLanguageExtensionsRemove.json */ @@ -22,7 +22,7 @@ public final class KustoPoolsOperationRemoveLanguageExtensionsSamples { */ public static void kustoPoolRemoveLanguageExtensions(com.azure.resourcemanager.synapse.SynapseManager manager) { manager - .kustoPoolsOperations() + .kustoPools() .removeLanguageExtensions( "kustorptest", "kustoclusterrptest4", diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStartSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStartSamples.java similarity index 74% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStartSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStartSamples.java index 593221d1ee69..26df6350e5c1 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStartSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStartSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Start. */ -public final class KustoPoolsOperationStartSamples { +/** Samples for KustoPools Start. */ +public final class KustoPoolsStartSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStart.json */ @@ -17,6 +17,6 @@ public final class KustoPoolsOperationStartSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsStop(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().start("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().start("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStopSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStopSamples.java similarity index 74% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStopSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStopSamples.java index fef7da214f0c..76e060ae55aa 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationStopSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsStopSamples.java @@ -6,8 +6,8 @@ import com.azure.core.util.Context; -/** Samples for KustoPoolsOperation Stop. */ -public final class KustoPoolsOperationStopSamples { +/** Samples for KustoPools Stop. */ +public final class KustoPoolsStopSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsStop.json */ @@ -17,6 +17,6 @@ public final class KustoPoolsOperationStopSamples { * @param manager Entry point to SynapseManager. */ public static void kustoPoolsStop(com.azure.resourcemanager.synapse.SynapseManager manager) { - manager.kustoPoolsOperations().stop("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); + manager.kustoPools().stop("kustorptest", "kustoclusterrptest4", "kustorptest", Context.NONE); } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationUpdateSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsUpdateSamples.java similarity index 90% rename from sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationUpdateSamples.java rename to sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsUpdateSamples.java index 42029a7288e7..9843a21a723d 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsOperationUpdateSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/KustoPoolsUpdateSamples.java @@ -10,8 +10,8 @@ import com.azure.resourcemanager.synapse.models.SkuName; import com.azure.resourcemanager.synapse.models.SkuSize; -/** Samples for KustoPoolsOperation Update. */ -public final class KustoPoolsOperationUpdateSamples { +/** Samples for KustoPools Update. */ +public final class KustoPoolsUpdateSamples { /* * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/preview/2021-06-01-preview/examples/KustoPoolsUpdate.json */ @@ -23,7 +23,7 @@ public final class KustoPoolsOperationUpdateSamples { public static void kustoPoolsUpdate(com.azure.resourcemanager.synapse.SynapseManager manager) { KustoPool resource = manager - .kustoPoolsOperations() + .kustoPools() .getWithResponse("synapseWorkspaceName", "kustoclusterrptest4", "kustorptest", Context.NONE) .getValue(); resource diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsCreateSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsCreateSamples.java index cf00299a1f28..d30eb5e802e7 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsCreateSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsCreateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.synapse.generated; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.StorageAccountType; import java.util.HashMap; @@ -31,7 +32,7 @@ public static void createASQLAnalyticsPool(com.azure.resourcemanager.synapse.Syn .withCollation("") .withSourceDatabaseId("") .withRecoverableDatabaseId("") - .withCreateMode("") + .withCreateMode(CreateMode.fromString("")) .withStorageAccountType(StorageAccountType.LRS) .create(); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsUpdateSamples.java b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsUpdateSamples.java index b4d0debef7a2..8a71c5cde510 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsUpdateSamples.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/samples/java/com/azure/resourcemanager/synapse/generated/SqlPoolsUpdateSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.synapse.generated; import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.models.CreateMode; import com.azure.resourcemanager.synapse.models.Sku; import com.azure.resourcemanager.synapse.models.SqlPool; import java.time.OffsetDateTime; @@ -36,7 +37,7 @@ public static void updateASQLAnalyticsPool(com.azure.resourcemanager.synapse.Syn .withSourceDatabaseId("") .withRecoverableDatabaseId("") .withRestorePointInTime(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) - .withCreateMode("") + .withCreateMode(CreateMode.fromString("")) .withCreationDate(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) .apply(); }