diff --git a/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md index a1d5fccf8675c..2c76c04ae8940 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md +++ b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-08-05) +- 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-preview-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-07) diff --git a/sdk/synapse/azure-resourcemanager-synapse/README.md b/sdk/synapse/azure-resourcemanager-synapse/README.md index 7ab6c9ee84803..07bc2cfb00c5d 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/README.md +++ b/sdk/synapse/azure-resourcemanager-synapse/README.md @@ -2,7 +2,7 @@ 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-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Synapse Management SDK. Azure Synapse Analytics Management Client. Package tag package-preview-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-synapse - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/synapse/azure-resourcemanager-synapse/pom.xml b/sdk/synapse/azure-resourcemanager-synapse/pom.xml index e1fe6373cc813..f9dadcd6e7d31 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/pom.xml +++ b/sdk/synapse/azure-resourcemanager-synapse/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-synapse - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-synapse + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Synapse Management - This package contains Microsoft Azure SDK for Synapse Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Synapse Analytics Management Client. Package tag package-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Synapse Management + This package contains Microsoft Azure SDK for Synapse Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Synapse Analytics Management Client. Package tag package-preview-2021-06. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.18.0 - - - com.azure - azure-core-management - 1.3.1 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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 85a061fd04d6b..9f3e9a65a97ee 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 @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,13 +16,18 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.synapse.fluent.SynapseManagementClient; +import com.azure.resourcemanager.synapse.implementation.AttachedDatabaseConfigurationsImpl; import com.azure.resourcemanager.synapse.implementation.BigDataPoolsImpl; +import com.azure.resourcemanager.synapse.implementation.DataConnectionsImpl; import com.azure.resourcemanager.synapse.implementation.DataMaskingPoliciesImpl; import com.azure.resourcemanager.synapse.implementation.DataMaskingRulesImpl; +import com.azure.resourcemanager.synapse.implementation.DatabasePrincipalAssignmentsImpl; +import com.azure.resourcemanager.synapse.implementation.DatabasesImpl; import com.azure.resourcemanager.synapse.implementation.ExtendedSqlPoolBlobAuditingPoliciesImpl; import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeAuthKeysOperationsImpl; import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeConnectionInfosImpl; @@ -36,6 +40,11 @@ import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimesImpl; import com.azure.resourcemanager.synapse.implementation.IpFirewallRulesImpl; import com.azure.resourcemanager.synapse.implementation.KeysImpl; +import com.azure.resourcemanager.synapse.implementation.KustoOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.KustoPoolChildResourcesImpl; +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; @@ -83,9 +92,13 @@ import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl; import com.azure.resourcemanager.synapse.implementation.WorkspaceSqlAadAdminsImpl; import com.azure.resourcemanager.synapse.implementation.WorkspacesImpl; +import com.azure.resourcemanager.synapse.models.AttachedDatabaseConfigurations; import com.azure.resourcemanager.synapse.models.BigDataPools; +import com.azure.resourcemanager.synapse.models.DataConnections; import com.azure.resourcemanager.synapse.models.DataMaskingPolicies; import com.azure.resourcemanager.synapse.models.DataMaskingRules; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignments; +import com.azure.resourcemanager.synapse.models.Databases; import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicies; import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAuthKeysOperations; import com.azure.resourcemanager.synapse.models.IntegrationRuntimeConnectionInfos; @@ -98,6 +111,11 @@ import com.azure.resourcemanager.synapse.models.IntegrationRuntimes; import com.azure.resourcemanager.synapse.models.IpFirewallRules; import com.azure.resourcemanager.synapse.models.Keys; +import com.azure.resourcemanager.synapse.models.KustoOperations; +import com.azure.resourcemanager.synapse.models.KustoPoolChildResources; +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; @@ -178,6 +196,24 @@ public final class SynapseManager { private Keys keys; + private KustoOperations kustoOperations; + + private KustoPools kustoPools; + + private KustoPoolsOperations kustoPoolsOperations; + + private KustoPoolChildResources kustoPoolChildResources; + + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + + private Databases databases; + + private DataConnections dataConnections; + + private KustoPoolPrincipalAssignments kustoPoolPrincipalAssignments; + + private DatabasePrincipalAssignments databasePrincipalAssignments; + private Libraries libraries; private LibrariesOperations librariesOperations; @@ -317,6 +353,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -356,6 +393,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -412,6 +460,9 @@ public SynapseManager authenticate(TokenCredential credential, AzureProfile prof userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -421,10 +472,7 @@ public SynapseManager authenticate(TokenCredential credential, AzureProfile prof HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -551,6 +599,82 @@ public Keys keys() { return keys; } + /** @return Resource collection API of KustoOperations. */ + public KustoOperations kustoOperations() { + if (this.kustoOperations == null) { + this.kustoOperations = new KustoOperationsImpl(clientObject.getKustoOperations(), this); + } + return kustoOperations; + } + + /** @return Resource collection API of KustoPools. */ + public KustoPools kustoPools() { + if (this.kustoPools == null) { + this.kustoPools = new KustoPoolsImpl(clientObject.getKustoPools(), this); + } + 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) { + this.kustoPoolChildResources = + new KustoPoolChildResourcesImpl(clientObject.getKustoPoolChildResources(), this); + } + return kustoPoolChildResources; + } + + /** @return Resource collection API of AttachedDatabaseConfigurations. */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = + new AttachedDatabaseConfigurationsImpl(clientObject.getAttachedDatabaseConfigurations(), this); + } + return attachedDatabaseConfigurations; + } + + /** @return Resource collection API of Databases. */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(clientObject.getDatabases(), this); + } + return databases; + } + + /** @return Resource collection API of DataConnections. */ + public DataConnections dataConnections() { + if (this.dataConnections == null) { + this.dataConnections = new DataConnectionsImpl(clientObject.getDataConnections(), this); + } + return dataConnections; + } + + /** @return Resource collection API of KustoPoolPrincipalAssignments. */ + public KustoPoolPrincipalAssignments kustoPoolPrincipalAssignments() { + if (this.kustoPoolPrincipalAssignments == null) { + this.kustoPoolPrincipalAssignments = + new KustoPoolPrincipalAssignmentsImpl(clientObject.getKustoPoolPrincipalAssignments(), this); + } + return kustoPoolPrincipalAssignments; + } + + /** @return Resource collection API of DatabasePrincipalAssignments. */ + public DatabasePrincipalAssignments databasePrincipalAssignments() { + if (this.databasePrincipalAssignments == null) { + this.databasePrincipalAssignments = + new DatabasePrincipalAssignmentsImpl(clientObject.getDatabasePrincipalAssignments(), this); + } + return databasePrincipalAssignments; + } + /** @return Resource collection API of Libraries. */ public Libraries libraries() { if (this.libraries == null) { diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/AttachedDatabaseConfigurationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/AttachedDatabaseConfigurationsClient.java new file mode 100644 index 0000000000000..c02f2cb1b0338 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/AttachedDatabaseConfigurationsClient.java @@ -0,0 +1,245 @@ +// 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.AttachedDatabaseConfigurationInner; + +/** An instance of this class provides access to all the operations defined in AttachedDatabaseConfigurationsClient. */ +public interface AttachedDatabaseConfigurationsClient { + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner get( + String workspaceName, String kustoPoolName, String attachedDatabaseConfigurationName, String resourceGroupName); + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context); + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AttachedDatabaseConfigurationInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters); + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AttachedDatabaseConfigurationInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context); + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters); + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AttachedDatabaseConfigurationInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, String kustoPoolName, String attachedDatabaseConfigurationName, String resourceGroupName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, String kustoPoolName, String attachedDatabaseConfigurationName, String resourceGroupName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataConnectionsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataConnectionsClient.java new file mode 100644 index 0000000000000..e3bd0cd3e6e66 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataConnectionsClient.java @@ -0,0 +1,510 @@ +// 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.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.synapse.models.DataConnectionCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in DataConnectionsClient. */ +public interface DataConnectionsClient { + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner get( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectionInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasePrincipalAssignmentsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasePrincipalAssignmentsClient.java new file mode 100644 index 0000000000000..30d264318036e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasePrincipalAssignmentsClient.java @@ -0,0 +1,322 @@ +// 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.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignmentCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in DatabasePrincipalAssignmentsClient. */ +public interface DatabasePrincipalAssignmentsClient { + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName); + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner get( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabasePrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters); + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabasePrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context); + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters); + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabasePrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasesClient.java new file mode 100644 index 0000000000000..fcb12aa13723c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DatabasesClient.java @@ -0,0 +1,318 @@ +// 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.DatabaseInner; + +/** An instance of this class provides access to all the operations defined in DatabasesClient. */ +public interface DatabasesClient { + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKustoPool(String resourceGroupName, String workspaceName, String kustoPoolName); + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName, Context context); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner get(String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoOperationsClient.java new file mode 100644 index 0000000000000..9a791f5052173 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoOperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in KustoOperationsClient. */ +public interface KustoOperationsClient { + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @param context The context to associate with this 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 result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolChildResourcesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolChildResourcesClient.java new file mode 100644 index 0000000000000..006cc76935a5f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolChildResourcesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.models.DatabaseCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in KustoPoolChildResourcesClient. */ +public interface KustoPoolChildResourcesClient { + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName); + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + DatabaseCheckNameRequest resourceName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolPrincipalAssignmentsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolPrincipalAssignmentsClient.java new file mode 100644 index 0000000000000..863586333bce3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolPrincipalAssignmentsClient.java @@ -0,0 +1,286 @@ +// 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.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignmentCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in KustoPoolPrincipalAssignmentsClient. */ +public interface KustoPoolPrincipalAssignmentsClient { + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner get( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName); + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters); + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context); + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters); + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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.SINGLE) + SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete(String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context); +} 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 new file mode 100644 index 0000000000000..2e0d19091eada --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; + +/** An instance of this class provides access to all the operations defined in KustoPoolsClient. */ +public interface KustoPoolsClient { + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @throws com.azure.core.management.exception.ManagementException 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 the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(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 new file mode 100644 index 0000000000000..6d145da837573 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KustoPoolsOperationsClient.java @@ -0,0 +1,838 @@ +// 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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/PrivateEndpointConnectionsPrivateLinkHubsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java index aaea5f3852f8a..9635d0029a2d0 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java @@ -7,6 +7,7 @@ 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.util.Context; import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; @@ -43,4 +44,35 @@ PagedIterable list( @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionForPrivateLinkHubInner get( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName); + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName, 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 68f7a2f1c32b4..52721db761f27 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 @@ -135,6 +135,69 @@ public interface SynapseManagementClient { */ KeysClient getKeys(); + /** + * Gets the KustoOperationsClient object to access its operations. + * + * @return the KustoOperationsClient object. + */ + KustoOperationsClient getKustoOperations(); + + /** + * Gets the KustoPoolsClient object to access its operations. + * + * @return the KustoPoolsClient object. + */ + KustoPoolsClient getKustoPools(); + + /** + * Gets the KustoPoolsOperationsClient object to access its operations. + * + * @return the KustoPoolsOperationsClient object. + */ + KustoPoolsOperationsClient getKustoPoolsOperations(); + + /** + * Gets the KustoPoolChildResourcesClient object to access its operations. + * + * @return the KustoPoolChildResourcesClient object. + */ + KustoPoolChildResourcesClient getKustoPoolChildResources(); + + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations(); + + /** + * Gets the DatabasesClient object to access its operations. + * + * @return the DatabasesClient object. + */ + DatabasesClient getDatabases(); + + /** + * Gets the DataConnectionsClient object to access its operations. + * + * @return the DataConnectionsClient object. + */ + DataConnectionsClient getDataConnections(); + + /** + * Gets the KustoPoolPrincipalAssignmentsClient object to access its operations. + * + * @return the KustoPoolPrincipalAssignmentsClient object. + */ + KustoPoolPrincipalAssignmentsClient getKustoPoolPrincipalAssignments(); + + /** + * Gets the DatabasePrincipalAssignmentsClient object to access its operations. + * + * @return the DatabasePrincipalAssignmentsClient object. + */ + DatabasePrincipalAssignmentsClient getDatabasePrincipalAssignments(); + /** * Gets the LibrariesClient object to access its operations. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AttachedDatabaseConfigurationInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AttachedDatabaseConfigurationInner.java new file mode 100644 index 0000000000000..24f9a4549c769 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AttachedDatabaseConfigurationInner.java @@ -0,0 +1,221 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DefaultPrincipalsModificationKind; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.azure.resourcemanager.synapse.models.TableLevelSharingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Class representing an attached database configuration. */ +@JsonFlatten +@Fluent +public class AttachedDatabaseConfigurationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /* + * The name of the database which you would like to attach, use * if you + * want to follow all current and future databases. + */ + @JsonProperty(value = "properties.databaseName") + private String databaseName; + + /* + * The resource id of the kusto pool where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId") + private String clusterResourceId; + + /* + * The list of databases from the clusterResourceId which are currently + * attached to the kusto pool. + */ + @JsonProperty(value = "properties.attachedDatabaseNames", access = JsonProperty.Access.WRITE_ONLY) + private List attachedDatabaseNames; + + /* + * The default principals modification kind + */ + @JsonProperty(value = "properties.defaultPrincipalsModificationKind") + private DefaultPrincipalsModificationKind defaultPrincipalsModificationKind; + + /* + * Table level sharing specifications + */ + @JsonProperty(value = "properties.tableLevelSharingProperties") + private TableLevelSharingProperties tableLevelSharingProperties; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @param databaseName the databaseName value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the clusterResourceId property: The resource id of the kusto pool where the databases you would like to + * attach reside. + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: The resource id of the kusto pool where the databases you would like to + * attach reside. + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the attachedDatabaseNames property: The list of databases from the clusterResourceId which are currently + * attached to the kusto pool. + * + * @return the attachedDatabaseNames value. + */ + public List attachedDatabaseNames() { + return this.attachedDatabaseNames; + } + + /** + * Get the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @return the defaultPrincipalsModificationKind value. + */ + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.defaultPrincipalsModificationKind; + } + + /** + * Set the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind the defaultPrincipalsModificationKind value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.defaultPrincipalsModificationKind = defaultPrincipalsModificationKind; + return this; + } + + /** + * Get the tableLevelSharingProperties property: Table level sharing specifications. + * + * @return the tableLevelSharingProperties value. + */ + public TableLevelSharingProperties tableLevelSharingProperties() { + return this.tableLevelSharingProperties; + } + + /** + * Set the tableLevelSharingProperties property: Table level sharing specifications. + * + * @param tableLevelSharingProperties the tableLevelSharingProperties value to set. + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withTableLevelSharingProperties( + TableLevelSharingProperties tableLevelSharingProperties) { + this.tableLevelSharingProperties = tableLevelSharingProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tableLevelSharingProperties() != null) { + tableLevelSharingProperties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AzureResourceSkuInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AzureResourceSkuInner.java new file mode 100644 index 0000000000000..d239ed869d544 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AzureResourceSkuInner.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AzureCapacity; +import com.azure.resourcemanager.synapse.models.AzureSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure resource SKU definition. */ +@Fluent +public final class AzureResourceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureResourceSkuInner.class); + + /* + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The SKU details. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /* + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private AzureCapacity capacity; + + /** + * Get the resourceType property: Resource Namespace and Type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource Namespace and Type. + * + * @param resourceType the resourceType value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sku property: The SKU details. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU details. + * + * @param sku the sku value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + public AzureCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The number of instances of the cluster. + * + * @param capacity the capacity value to set. + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withCapacity(AzureCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (capacity() != null) { + capacity().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java index 19b1ca5ba7d3e..0225591ef3ad2 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java @@ -34,7 +34,7 @@ public class BigDataPoolResourceInfoInner extends Resource { private String provisioningState; /* - * Auto-scaling properties + * Spark pool auto-scaling properties Auto-scaling properties */ @JsonProperty(value = "properties.autoScale") private AutoScaleProperties autoScale; @@ -46,7 +46,7 @@ public class BigDataPoolResourceInfoInner extends Resource { private OffsetDateTime creationDate; /* - * Auto-pausing properties + * Spark pool auto-pausing properties Auto-pausing properties */ @JsonProperty(value = "properties.autoPause") private AutoPauseProperties autoPause; @@ -88,7 +88,7 @@ public class BigDataPoolResourceInfoInner extends Resource { private Integer nodeCount; /* - * Library version requirements + * Spark pool library version requirements Library version requirements */ @JsonProperty(value = "properties.libraryRequirements") private LibraryRequirements libraryRequirements; @@ -100,7 +100,8 @@ public class BigDataPoolResourceInfoInner extends Resource { private List customLibraries; /* - * Spark configuration file to specify additional properties + * Spark pool library version requirements Spark configuration file to + * specify additional properties */ @JsonProperty(value = "properties.sparkConfigProperties") private LibraryRequirements sparkConfigProperties; @@ -156,7 +157,7 @@ public BigDataPoolResourceInfoInner withProvisioningState(String provisioningSta } /** - * Get the autoScale property: Auto-scaling properties. + * Get the autoScale property: Spark pool auto-scaling properties Auto-scaling properties. * * @return the autoScale value. */ @@ -165,7 +166,7 @@ public AutoScaleProperties autoScale() { } /** - * Set the autoScale property: Auto-scaling properties. + * Set the autoScale property: Spark pool auto-scaling properties Auto-scaling properties. * * @param autoScale the autoScale value to set. * @return the BigDataPoolResourceInfoInner object itself. @@ -196,7 +197,7 @@ public BigDataPoolResourceInfoInner withCreationDate(OffsetDateTime creationDate } /** - * Get the autoPause property: Auto-pausing properties. + * Get the autoPause property: Spark pool auto-pausing properties Auto-pausing properties. * * @return the autoPause value. */ @@ -205,7 +206,7 @@ public AutoPauseProperties autoPause() { } /** - * Set the autoPause property: Auto-pausing properties. + * Set the autoPause property: Spark pool auto-pausing properties Auto-pausing properties. * * @param autoPause the autoPause value to set. * @return the BigDataPoolResourceInfoInner object itself. @@ -337,7 +338,7 @@ public BigDataPoolResourceInfoInner withNodeCount(Integer nodeCount) { } /** - * Get the libraryRequirements property: Library version requirements. + * Get the libraryRequirements property: Spark pool library version requirements Library version requirements. * * @return the libraryRequirements value. */ @@ -346,7 +347,7 @@ public LibraryRequirements libraryRequirements() { } /** - * Set the libraryRequirements property: Library version requirements. + * Set the libraryRequirements property: Spark pool library version requirements Library version requirements. * * @param libraryRequirements the libraryRequirements value to set. * @return the BigDataPoolResourceInfoInner object itself. @@ -377,7 +378,8 @@ public BigDataPoolResourceInfoInner withCustomLibraries(List custom } /** - * Get the sparkConfigProperties property: Spark configuration file to specify additional properties. + * Get the sparkConfigProperties property: Spark pool library version requirements Spark configuration file to + * specify additional properties. * * @return the sparkConfigProperties value. */ @@ -386,7 +388,8 @@ public LibraryRequirements sparkConfigProperties() { } /** - * Set the sparkConfigProperties property: Spark configuration file to specify additional properties. + * Set the sparkConfigProperties property: Spark pool library version requirements Spark configuration file to + * specify additional properties. * * @param sparkConfigProperties the sparkConfigProperties value to set. * @return the BigDataPoolResourceInfoInner object itself. diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameResultInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameResultInner.java new file mode 100644 index 0000000000000..a2a72a787e0de --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameResultInner.java @@ -0,0 +1,132 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.Reason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result returned from a check name availability request. */ +@Fluent +public final class CheckNameResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameResultInner.class); + + /* + * Specifies a Boolean value that indicates if the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The name that was checked. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Message providing the reason why the given name is invalid. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /** + * Get the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the name property: The name that was checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name that was checked. + * + * @param name the name value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @param message the message value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the reason property: Message providing the reason why the given name is invalid. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Set the reason property: Message providing the reason why the given name is invalid. + * + * @param reason the reason value to set. + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ClusterPrincipalAssignmentInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ClusterPrincipalAssignmentInner.java new file mode 100644 index 0000000000000..a353fd8051a0d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ClusterPrincipalAssignmentInner.java @@ -0,0 +1,199 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalRole; +import com.azure.resourcemanager.synapse.models.PrincipalType; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing a cluster principal assignment. */ +@JsonFlatten +@Fluent +public class ClusterPrincipalAssignmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Cluster principal role. + */ + @JsonProperty(value = "properties.role") + private ClusterPrincipalRole role; + + /* + * The tenant id of the principal + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Principal type. + */ + @JsonProperty(value = "properties.principalType") + private PrincipalType principalType; + + /* + * The tenant name of the principal + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /* + * The principal name + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @param principalId the principalId value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the role property: Cluster principal role. + * + * @return the role value. + */ + public ClusterPrincipalRole role() { + return this.role; + } + + /** + * Set the role property: Cluster principal role. + * + * @param role the role value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withRole(ClusterPrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the principal. + * + * @param tenantId the tenantId value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the principalType property: Principal type. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Principal type. + * + * @param principalType the principalType value to set. + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principalName property: The principal name. + * + * @return the principalName value. + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionInner.java new file mode 100644 index 0000000000000..5dc679d9dd9d2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.EventGridDataConnection; +import com.azure.resourcemanager.synapse.models.EventHubDataConnection; +import com.azure.resourcemanager.synapse.models.IotHubDataConnection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Class representing a data connection. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DataConnectionInner.class) +@JsonTypeName("DataConnection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "EventHub", value = EventHubDataConnection.class), + @JsonSubTypes.Type(name = "IotHub", value = IotHubDataConnection.class), + @JsonSubTypes.Type(name = "EventGrid", value = EventGridDataConnection.class) +}) +@Fluent +public class DataConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the DataConnectionInner object itself. + */ + public DataConnectionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationInner.java new file mode 100644 index 0000000000000..3c35d9f3e3856 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationInner.java @@ -0,0 +1,79 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing an data connection validation. */ +@Fluent +public final class DataConnectionValidationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationInner.class); + + /* + * The name of the data connection. + */ + @JsonProperty(value = "dataConnectionName") + private String dataConnectionName; + + /* + * The data connection properties to validate. + */ + @JsonProperty(value = "properties") + private DataConnectionInner properties; + + /** + * Get the dataConnectionName property: The name of the data connection. + * + * @return the dataConnectionName value. + */ + public String dataConnectionName() { + return this.dataConnectionName; + } + + /** + * Set the dataConnectionName property: The name of the data connection. + * + * @param dataConnectionName the dataConnectionName value to set. + * @return the DataConnectionValidationInner object itself. + */ + public DataConnectionValidationInner withDataConnectionName(String dataConnectionName) { + this.dataConnectionName = dataConnectionName; + return this; + } + + /** + * Get the properties property: The data connection properties to validate. + * + * @return the properties value. + */ + public DataConnectionInner properties() { + return this.properties; + } + + /** + * Set the properties property: The data connection properties to validate. + * + * @param properties the properties value to set. + * @return the DataConnectionValidationInner object itself. + */ + public DataConnectionValidationInner withProperties(DataConnectionInner properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationListResultInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationListResultInner.java new file mode 100644 index 0000000000000..bda1e067fd5bb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataConnectionValidationListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DataConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto data connection validation result. */ +@Fluent +public final class DataConnectionValidationListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationListResultInner.class); + + /* + * The list of Kusto data connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto data connection validation errors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto data connection validation errors. + * + * @param value the value value to set. + * @return the DataConnectionValidationListResultInner object itself. + */ + public DataConnectionValidationListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabaseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabaseInner.java new file mode 100644 index 0000000000000..7ce06d4f38f01 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabaseInner.java @@ -0,0 +1,79 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ReadWriteDatabase; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Class representing a Kusto database. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DatabaseInner.class) +@JsonTypeName("Database") +@JsonSubTypes({@JsonSubTypes.Type(name = "ReadWrite", value = ReadWriteDatabase.class)}) +@Fluent +public class DatabaseInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the DatabaseInner object itself. + */ + public DatabaseInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabasePrincipalAssignmentInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabasePrincipalAssignmentInner.java new file mode 100644 index 0000000000000..a9902e37bfba5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DatabasePrincipalAssignmentInner.java @@ -0,0 +1,199 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalRole; +import com.azure.resourcemanager.synapse.models.PrincipalType; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing a database principal assignment. */ +@JsonFlatten +@Fluent +public class DatabasePrincipalAssignmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentInner.class); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Database principal role. + */ + @JsonProperty(value = "properties.role") + private DatabasePrincipalRole role; + + /* + * The tenant id of the principal + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Principal type. + */ + @JsonProperty(value = "properties.principalType") + private PrincipalType principalType; + + /* + * The tenant name of the principal + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /* + * The principal name + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @param principalId the principalId value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the role property: Database principal role. + * + * @return the role value. + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set the role property: Database principal role. + * + * @param role the role value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant id of the principal. + * + * @param tenantId the tenantId value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the principalType property: Principal type. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Principal type. + * + * @param principalType the principalType value to set. + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principalName property: The principal name. + * + * @return the principalName value. + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/FollowerDatabaseDefinitionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/FollowerDatabaseDefinitionInner.java new file mode 100644 index 0000000000000..49b71c94f79ea --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/FollowerDatabaseDefinitionInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A class representing follower database request. */ +@Fluent +public final class FollowerDatabaseDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FollowerDatabaseDefinitionInner.class); + + /* + * Resource id of the cluster that follows a database owned by this + * cluster. + */ + @JsonProperty(value = "clusterResourceId", required = true) + private String clusterResourceId; + + /* + * Resource name of the attached database configuration in the follower + * cluster. + */ + @JsonProperty(value = "attachedDatabaseConfigurationName", required = true) + private String attachedDatabaseConfigurationName; + + /* + * The database name owned by this cluster that was followed. * in case + * following all databases. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Get the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value. + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @param clusterResourceId the clusterResourceId value to set. + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @return the attachedDatabaseConfigurationName value. + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Set the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @param attachedDatabaseConfigurationName the attachedDatabaseConfigurationName value to set. + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withAttachedDatabaseConfigurationName( + String attachedDatabaseConfigurationName) { + this.attachedDatabaseConfigurationName = attachedDatabaseConfigurationName; + return this; + } + + /** + * Get the databaseName property: The database name owned by this cluster that was followed. * in case following all + * databases. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterResourceId in model FollowerDatabaseDefinitionInner")); + } + if (attachedDatabaseConfigurationName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property attachedDatabaseConfigurationName in model" + + " FollowerDatabaseDefinitionInner")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolInner.java new file mode 100644 index 0000000000000..7d1caa0ddd3ed --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolInner.java @@ -0,0 +1,312 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AzureSku; +import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; +import com.azure.resourcemanager.synapse.models.OptimizedAutoscale; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.azure.resourcemanager.synapse.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Class representing a Kusto kusto pool. */ +@JsonFlatten +@Fluent +public class KustoPoolInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolInner.class); + + /* + * The SKU of the kusto pool. + */ + @JsonProperty(value = "sku", required = true) + private AzureSku sku; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The state of the resource. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /* + * The Kusto Pool URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * The Kusto Pool data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /* + * The reason for the Kusto Pool's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /* + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /* + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /* + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /* + * List of the Kusto Pool's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /* + * The workspace unique identifier. + */ + @JsonProperty(value = "properties.workspaceUID") + private String workspaceUid; + + /** + * Get the sku property: The SKU of the kusto pool. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the kusto pool. + * + * @param sku the sku value to set. + * @return the KustoPoolInner object itself. + */ + public KustoPoolInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the state property: The state of the resource. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the uri property: The Kusto Pool URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: The Kusto Pool data ingestion URI. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the stateReason property: The reason for the Kusto Pool's current state. + * + * @return the stateReason value. + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set the optimizedAutoscale property: Optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set. + * @return the KustoPoolInner object itself. + */ + public KustoPoolInner withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set. + * @return the KustoPoolInner object itself. + */ + public KustoPoolInner withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set. + * @return the KustoPoolInner object itself. + */ + public KustoPoolInner withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get the languageExtensions property: List of the Kusto Pool's language extensions. + * + * @return the languageExtensions value. + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get the workspaceUid property: The workspace unique identifier. + * + * @return the workspaceUid value. + */ + public String workspaceUid() { + return this.workspaceUid; + } + + /** + * Set the workspaceUid property: The workspace unique identifier. + * + * @param workspaceUid the workspaceUid value to set. + * @return the KustoPoolInner object itself. + */ + public KustoPoolInner withWorkspaceUid(String workspaceUid) { + this.workspaceUid = workspaceUid; + return this; + } + + /** {@inheritDoc} */ + @Override + public KustoPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public KustoPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model KustoPoolInner")); + } else { + sku().validate(); + } + if (optimizedAutoscale() != null) { + optimizedAutoscale().validate(); + } + if (languageExtensions() != null) { + languageExtensions().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolListResultInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolListResultInner.java new file mode 100644 index 0000000000000..87a40a6a4e282 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KustoPoolListResultInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto pools operation response. */ +@Fluent +public final class KustoPoolListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolListResultInner.class); + + /* + * The list of Kusto pools. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto pools. + * + * @param value the value value to set. + * @return the KustoPoolListResultInner object itself. + */ + public KustoPoolListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LanguageExtensionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LanguageExtensionInner.java new file mode 100644 index 0000000000000..20f541989c0a4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LanguageExtensionInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.LanguageExtensionName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The language extension object. */ +@Fluent +public final class LanguageExtensionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LanguageExtensionInner.class); + + /* + * The language extension name. + */ + @JsonProperty(value = "languageExtensionName") + private LanguageExtensionName languageExtensionName; + + /** + * Get the languageExtensionName property: The language extension name. + * + * @return the languageExtensionName value. + */ + public LanguageExtensionName languageExtensionName() { + return this.languageExtensionName; + } + + /** + * Set the languageExtensionName property: The language extension name. + * + * @param languageExtensionName the languageExtensionName value to set. + * @return the LanguageExtensionInner object itself. + */ + public LanguageExtensionInner withLanguageExtensionName(LanguageExtensionName languageExtensionName) { + this.languageExtensionName = languageExtensionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..6f47a74d89b8c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationInner.java @@ -0,0 +1,133 @@ +// 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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The operation name. This is of the format + * {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Any object + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: The operation name. This is of the format {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. This is of the format {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that describes the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that describes the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Any object. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Any object. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java index 8668c0d53b99a..5bd1e58fe72d4 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.HashMap; @@ -49,6 +50,7 @@ public final class SelfHostedIntegrationRuntimeNodeInner { * The integration runtime capabilities dictionary */ @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map capabilities; /* diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SkuDescriptionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SkuDescriptionInner.java new file mode 100644 index 0000000000000..353578fdee7d3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SkuDescriptionInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Kusto SKU description of given resource type. */ +@Immutable +public final class SkuDescriptionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDescriptionInner.class); + + /* + * The resource type + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of the SKU + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The size of the SKU + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /* + * The set of locations that the SKU is available + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * Locations and zones + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The restrictions because of which SKU cannot be used + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the size property: The size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + } +} 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 5c332d89b5542..119e78d29f5f3 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 @@ -22,7 +22,7 @@ public class SqlPoolInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolInner.class); /* - * SQL pool SKU + * Sku SQL pool SKU */ @JsonProperty(value = "sku") private Sku sku; @@ -88,7 +88,7 @@ public class SqlPoolInner extends Resource { private StorageAccountType storageAccountType; /** - * Get the sku property: SQL pool SKU. + * Get the sku property: Sku SQL pool SKU. * * @return the sku value. */ @@ -97,7 +97,7 @@ public Sku sku() { } /** - * Set the sku property: SQL pool SKU. + * Set the sku property: Sku SQL pool SKU. * * @param sku the sku value to set. * @return the SqlPoolInner object itself. diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java index 63e9a99043716..190d9ac3e4f34 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.CspWorkspaceAdminProperties; import com.azure.resourcemanager.synapse.models.DataLakeStorageAccountDetails; import com.azure.resourcemanager.synapse.models.EncryptionDetails; import com.azure.resourcemanager.synapse.models.ManagedIdentity; @@ -17,6 +18,7 @@ import com.azure.resourcemanager.synapse.models.WorkspacePublicNetworkAccess; import com.azure.resourcemanager.synapse.models.WorkspaceRepositoryConfiguration; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -78,6 +80,7 @@ public class WorkspaceInner extends Resource { * Connectivity endpoints */ @JsonProperty(value = "properties.connectivityEndpoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map connectivityEndpoints; /* @@ -109,6 +112,7 @@ public class WorkspaceInner extends Resource { * Workspace level configs and feature flags */ @JsonProperty(value = "properties.extraProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map extraProperties; /* @@ -136,11 +140,17 @@ public class WorkspaceInner extends Resource { private String adlaResourceId; /* - * Enable or Disable pubic network access to workspace + * Enable or Disable public network access to workspace */ @JsonProperty(value = "properties.publicNetworkAccess") private WorkspacePublicNetworkAccess publicNetworkAccess; + /* + * Initial workspace AAD admin properties for a CSP subscription + */ + @JsonProperty(value = "properties.cspWorkspaceAdminProperties") + private CspWorkspaceAdminProperties cspWorkspaceAdminProperties; + /** * Get the identity property: Identity of the workspace. * @@ -449,7 +459,7 @@ public String adlaResourceId() { } /** - * Get the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Get the publicNetworkAccess property: Enable or Disable public network access to workspace. * * @return the publicNetworkAccess value. */ @@ -458,7 +468,7 @@ public WorkspacePublicNetworkAccess publicNetworkAccess() { } /** - * Set the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Set the publicNetworkAccess property: Enable or Disable public network access to workspace. * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspaceInner object itself. @@ -468,6 +478,26 @@ public WorkspaceInner withPublicNetworkAccess(WorkspacePublicNetworkAccess publi return this; } + /** + * Get the cspWorkspaceAdminProperties property: Initial workspace AAD admin properties for a CSP subscription. + * + * @return the cspWorkspaceAdminProperties value. + */ + public CspWorkspaceAdminProperties cspWorkspaceAdminProperties() { + return this.cspWorkspaceAdminProperties; + } + + /** + * Set the cspWorkspaceAdminProperties property: Initial workspace AAD admin properties for a CSP subscription. + * + * @param cspWorkspaceAdminProperties the cspWorkspaceAdminProperties value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withCspWorkspaceAdminProperties(CspWorkspaceAdminProperties cspWorkspaceAdminProperties) { + this.cspWorkspaceAdminProperties = cspWorkspaceAdminProperties; + return this; + } + /** {@inheritDoc} */ @Override public WorkspaceInner withLocation(String location) { @@ -512,5 +542,8 @@ public void validate() { if (purviewConfiguration() != null) { purviewConfiguration().validate(); } + if (cspWorkspaceAdminProperties() != null) { + cspWorkspaceAdminProperties().validate(); + } } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationImpl.java new file mode 100644 index 0000000000000..ac1abaa42ca9b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationImpl.java @@ -0,0 +1,242 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.synapse.models.AttachedDatabaseConfiguration; +import com.azure.resourcemanager.synapse.models.DefaultPrincipalsModificationKind; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.azure.resourcemanager.synapse.models.TableLevelSharingProperties; +import java.util.Collections; +import java.util.List; + +public final class AttachedDatabaseConfigurationImpl + implements AttachedDatabaseConfiguration, + AttachedDatabaseConfiguration.Definition, + AttachedDatabaseConfiguration.Update { + private AttachedDatabaseConfigurationInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public String clusterResourceId() { + return this.innerModel().clusterResourceId(); + } + + public List attachedDatabaseNames() { + List inner = this.innerModel().attachedDatabaseNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.innerModel().defaultPrincipalsModificationKind(); + } + + public TableLevelSharingProperties tableLevelSharingProperties() { + return this.innerModel().tableLevelSharingProperties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public AttachedDatabaseConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + private String workspaceName; + + private String kustoPoolName; + + private String attachedDatabaseConfigurationName; + + private String resourceGroupName; + + public AttachedDatabaseConfigurationImpl withExistingKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName) { + this.workspaceName = workspaceName; + this.kustoPoolName = kustoPoolName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public AttachedDatabaseConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public AttachedDatabaseConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + AttachedDatabaseConfigurationImpl(String name, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = new AttachedDatabaseConfigurationInner(); + this.serviceManager = serviceManager; + this.attachedDatabaseConfigurationName = name; + } + + public AttachedDatabaseConfigurationImpl update() { + return this; + } + + public AttachedDatabaseConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public AttachedDatabaseConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .createOrUpdate( + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + AttachedDatabaseConfigurationImpl( + AttachedDatabaseConfigurationInner innerObject, + com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.kustoPoolName = Utils.getValueFromIdByName(innerObject.id(), "kustoPools"); + this.attachedDatabaseConfigurationName = + Utils.getValueFromIdByName(innerObject.id(), "attachedDatabaseConfigurations"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public AttachedDatabaseConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .getWithResponse( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public AttachedDatabaseConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAttachedDatabaseConfigurations() + .getWithResponse( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context) + .getValue(); + return this; + } + + public AttachedDatabaseConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AttachedDatabaseConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AttachedDatabaseConfigurationImpl withDatabaseName(String databaseName) { + this.innerModel().withDatabaseName(databaseName); + return this; + } + + public AttachedDatabaseConfigurationImpl withClusterResourceId(String clusterResourceId) { + this.innerModel().withClusterResourceId(clusterResourceId); + return this; + } + + public AttachedDatabaseConfigurationImpl withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.innerModel().withDefaultPrincipalsModificationKind(defaultPrincipalsModificationKind); + return this; + } + + public AttachedDatabaseConfigurationImpl withTableLevelSharingProperties( + TableLevelSharingProperties tableLevelSharingProperties) { + this.innerModel().withTableLevelSharingProperties(tableLevelSharingProperties); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsClientImpl.java new file mode 100644 index 0000000000000..c54549d6f262b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsClientImpl.java @@ -0,0 +1,1229 @@ +// 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.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.AttachedDatabaseConfigurationsClient; +import com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.synapse.models.AttachedDatabaseConfigurationListResult; +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 AttachedDatabaseConfigurationsClient. */ +public final class AttachedDatabaseConfigurationsClientImpl implements AttachedDatabaseConfigurationsClient { + private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AttachedDatabaseConfigurationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of AttachedDatabaseConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AttachedDatabaseConfigurationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + AttachedDatabaseConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientAttachedDatabaseConfigurations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface AttachedDatabaseConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/attachedDatabaseConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByKustoPool( + @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}/attachedDatabaseConfigurations" + + "/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @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}/attachedDatabaseConfigurations" + + "/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AttachedDatabaseConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/attachedDatabaseConfigurations" + + "/{attachedDatabaseConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByKustoPoolSinglePageAsync( + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByKustoPool( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByKustoPoolSinglePageAsync( + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByKustoPool( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKustoPoolAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedFlux<>(() -> listByKustoPoolSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKustoPoolAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByKustoPoolSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedIterable<>(listByKustoPoolAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByKustoPoolAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + return getWithResponseAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner get( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + return getAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName).block(); + } + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + return getWithResponseAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context) + .block(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters) { + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AttachedDatabaseConfigurationInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDatabaseConfigurationInner.class, + AttachedDatabaseConfigurationInner.class, + Context.NONE); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AttachedDatabaseConfigurationInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + resourceGroupName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AttachedDatabaseConfigurationInner.class, + AttachedDatabaseConfigurationInner.class, + context); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AttachedDatabaseConfigurationInner> + beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AttachedDatabaseConfigurationInner> + beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters) + .block(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 an attached database configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AttachedDatabaseConfigurationInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + AttachedDatabaseConfigurationInner parameters, + Context context) { + return createOrUpdateAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, parameters, context) + .block(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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>> deleteWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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>> deleteWithResponseAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + 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 (attachedDatabaseConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter attachedDatabaseConfigurationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + attachedDatabaseConfigurationName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName) + .getSyncPoller(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + return beginDeleteAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 deleteAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 deleteAsync( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + return beginDeleteAsync( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + deleteAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName).block(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + deleteAsync(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsImpl.java new file mode 100644 index 0000000000000..7b904c00d65d9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AttachedDatabaseConfigurationsImpl.java @@ -0,0 +1,267 @@ +// 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.AttachedDatabaseConfigurationsClient; +import com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.synapse.models.AttachedDatabaseConfiguration; +import com.azure.resourcemanager.synapse.models.AttachedDatabaseConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AttachedDatabaseConfigurationsImpl implements AttachedDatabaseConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationsImpl.class); + + private final AttachedDatabaseConfigurationsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public AttachedDatabaseConfigurationsImpl( + AttachedDatabaseConfigurationsClient innerClient, + com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByKustoPool(workspaceName, kustoPoolName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AttachedDatabaseConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByKustoPool(workspaceName, kustoPoolName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AttachedDatabaseConfigurationImpl(inner1, this.manager())); + } + + public AttachedDatabaseConfiguration get( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + AttachedDatabaseConfigurationInner inner = + this + .serviceClient() + .get(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName); + if (inner != null) { + return new AttachedDatabaseConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AttachedDatabaseConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName) { + this.serviceClient().delete(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName); + } + + public void delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context) { + this + .serviceClient() + .delete(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context); + } + + public AttachedDatabaseConfiguration 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 attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + 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, attachedDatabaseConfigurationName, 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 attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + 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, attachedDatabaseConfigurationName, 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 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 attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + 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))); + } + this.delete(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, 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 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 attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations"); + if (attachedDatabaseConfigurationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'attachedDatabaseConfigurations'.", + 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))); + } + this.delete(workspaceName, kustoPoolName, attachedDatabaseConfigurationName, resourceGroupName, context); + } + + private AttachedDatabaseConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + public AttachedDatabaseConfigurationImpl define(String name) { + return new AttachedDatabaseConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AzureResourceSkuImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AzureResourceSkuImpl.java new file mode 100644 index 0000000000000..56696e2a775e7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AzureResourceSkuImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; +import com.azure.resourcemanager.synapse.models.AzureCapacity; +import com.azure.resourcemanager.synapse.models.AzureResourceSku; +import com.azure.resourcemanager.synapse.models.AzureSku; + +public final class AzureResourceSkuImpl implements AzureResourceSku { + private AzureResourceSkuInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + AzureResourceSkuImpl( + AzureResourceSkuInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public AzureSku sku() { + return this.innerModel().sku(); + } + + public AzureCapacity capacity() { + return this.innerModel().capacity(); + } + + public AzureResourceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameResultImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameResultImpl.java new file mode 100644 index 0000000000000..a9164620a626b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameResultImpl.java @@ -0,0 +1,45 @@ +// 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.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.Reason; + +public final class CheckNameResultImpl implements CheckNameResult { + private CheckNameResultInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + CheckNameResultImpl( + CheckNameResultInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String name() { + return this.innerModel().name(); + } + + public String message() { + return this.innerModel().message(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public CheckNameResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ClusterPrincipalAssignmentImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ClusterPrincipalAssignmentImpl.java new file mode 100644 index 0000000000000..44a9544ee59ae --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ClusterPrincipalAssignmentImpl.java @@ -0,0 +1,208 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignment; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalRole; +import com.azure.resourcemanager.synapse.models.PrincipalType; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; + +public final class ClusterPrincipalAssignmentImpl + implements ClusterPrincipalAssignment, ClusterPrincipalAssignment.Definition, ClusterPrincipalAssignment.Update { + private ClusterPrincipalAssignmentInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public ClusterPrincipalRole role() { + return this.innerModel().role(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String tenantName() { + return this.innerModel().tenantName(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ClusterPrincipalAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + private String workspaceName; + + private String kustoPoolName; + + private String principalAssignmentName; + + private String resourceGroupName; + + public ClusterPrincipalAssignmentImpl withExistingKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName) { + this.workspaceName = workspaceName; + this.kustoPoolName = kustoPoolName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public ClusterPrincipalAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public ClusterPrincipalAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + ClusterPrincipalAssignmentImpl(String name, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = new ClusterPrincipalAssignmentInner(); + this.serviceManager = serviceManager; + this.principalAssignmentName = name; + } + + public ClusterPrincipalAssignmentImpl update() { + return this; + } + + public ClusterPrincipalAssignment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public ClusterPrincipalAssignment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + ClusterPrincipalAssignmentImpl( + ClusterPrincipalAssignmentInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.kustoPoolName = Utils.getValueFromIdByName(innerObject.id(), "kustoPools"); + this.principalAssignmentName = Utils.getValueFromIdByName(innerObject.id(), "principalAssignments"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public ClusterPrincipalAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .getWithResponse(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public ClusterPrincipalAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolPrincipalAssignments() + .getWithResponse(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context) + .getValue(); + return this; + } + + public ClusterPrincipalAssignmentImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public ClusterPrincipalAssignmentImpl withRole(ClusterPrincipalRole role) { + this.innerModel().withRole(role); + return this; + } + + public ClusterPrincipalAssignmentImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public ClusterPrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.innerModel().withPrincipalType(principalType); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionImpl.java new file mode 100644 index 0000000000000..ed86f2f9a6c3d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.synapse.models.DataConnection; + +public final class DataConnectionImpl implements DataConnection { + private DataConnectionInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + DataConnectionImpl( + DataConnectionInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationImpl.java new file mode 100644 index 0000000000000..3d797eb90db7b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationImpl.java @@ -0,0 +1,43 @@ +// 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.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.synapse.models.DataConnection; +import com.azure.resourcemanager.synapse.models.DataConnectionValidation; + +public final class DataConnectionValidationImpl implements DataConnectionValidation { + private DataConnectionValidationInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + DataConnectionValidationImpl( + DataConnectionValidationInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String dataConnectionName() { + return this.innerModel().dataConnectionName(); + } + + public DataConnection properties() { + DataConnectionInner inner = this.innerModel().properties(); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnectionValidationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationListResultImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationListResultImpl.java new file mode 100644 index 0000000000000..deea9e0b5322c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionValidationListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.synapse.models.DataConnectionValidationListResult; +import com.azure.resourcemanager.synapse.models.DataConnectionValidationResult; +import java.util.Collections; +import java.util.List; + +public final class DataConnectionValidationListResultImpl implements DataConnectionValidationListResult { + private DataConnectionValidationListResultInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + DataConnectionValidationListResultImpl( + DataConnectionValidationListResultInner innerObject, + com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataConnectionValidationListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsClientImpl.java new file mode 100644 index 0000000000000..c680328ca4819 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsClientImpl.java @@ -0,0 +1,2336 @@ +// 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.DataConnectionsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.synapse.models.DataConnectionCheckNameRequest; +import com.azure.resourcemanager.synapse.models.DataConnectionListResult; +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 DataConnectionsClient. */ +public final class DataConnectionsClientImpl implements DataConnectionsClient { + private final ClientLogger logger = new ClientLogger(DataConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataConnectionsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of DataConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectionsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(DataConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientDataConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface DataConnectionsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionCheckNameRequest dataConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnectionValidation") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> dataConnectionValidation( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionValidationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabase( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @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}/databases/{databaseName}/dataConnections" + + "/{dataConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @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}/databases/{databaseName}/dataConnections" + + "/{dataConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections" + + "/{dataConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections" + + "/{dataConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("dataConnectionName") String dataConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } else { + dataConnectionName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + dataConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } else { + dataConnectionName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + dataConnectionName, + accept, + context); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + return checkNameAvailabilityAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName) + .block(); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context) + .block(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> dataConnectionValidationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .dataConnectionValidation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> dataConnectionValidationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .dataConnectionValidation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionValidationListResultInner> + beginDataConnectionValidationAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + Mono>> mono = + dataConnectionValidationWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionValidationListResultInner.class, + DataConnectionValidationListResultInner.class, + Context.NONE); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionValidationListResultInner> + beginDataConnectionValidationAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + dataConnectionValidationWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionValidationListResultInner.class, + DataConnectionValidationListResultInner.class, + context); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + return beginDataConnectionValidationAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .getSyncPoller(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionValidationListResultInner> + beginDataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return beginDataConnectionValidationAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .getSyncPoller(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono dataConnectionValidationAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + return beginDataConnectionValidationAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono dataConnectionValidationAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return beginDataConnectionValidationAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + return dataConnectionValidationAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .block(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 data connection validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionValidationListResultInner dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + return dataConnectionValidationAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .block(); + } + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseSinglePageAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDatabase( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + 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 list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseSinglePageAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDatabase( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return new PagedFlux<>( + () -> listByDatabaseSinglePageAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName)); + } + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + return new PagedFlux<>( + () -> + listByDatabaseSinglePageAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context)); + } + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return new PagedIterable<>(listByDatabaseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName)); + } + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + return new PagedIterable<>( + listByDatabaseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context)); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner get( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + return getAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName).block(); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context) + .block(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionInner.class, + DataConnectionInner.class, + Context.NONE); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataConnectionInner.class, DataConnectionInner.class, context); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .block(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .block(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataConnectionInner.class, + DataConnectionInner.class, + Context.NONE); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataConnectionInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DataConnectionInner.class, DataConnectionInner.class, context); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataConnectionInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return beginUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + return updateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters) + .block(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 data connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectionInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + return updateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, context) + .block(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (dataConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName) + .getSyncPoller(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + return beginDeleteAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + deleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName).block(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + deleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsImpl.java new file mode 100644 index 0000000000000..6e203dd87a846 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataConnectionsImpl.java @@ -0,0 +1,283 @@ +// 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.DataConnectionsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.DataConnection; +import com.azure.resourcemanager.synapse.models.DataConnectionCheckNameRequest; +import com.azure.resourcemanager.synapse.models.DataConnectionValidationListResult; +import com.azure.resourcemanager.synapse.models.DataConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataConnectionsImpl implements DataConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionsImpl.class); + + private final DataConnectionsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public DataConnectionsImpl( + DataConnectionsClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName) { + CheckNameResultInner inner = + this + .serviceClient() + .checkNameAvailability( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters) { + DataConnectionValidationListResultInner inner = + this + .serviceClient() + .dataConnectionValidation(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + if (inner != null) { + return new DataConnectionValidationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context) { + DataConnectionValidationListResultInner inner = + this + .serviceClient() + .dataConnectionValidation( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + if (inner != null) { + return new DataConnectionValidationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + PagedIterable inner = + this.serviceClient().listByDatabase(resourceGroupName, workspaceName, kustoPoolName, databaseName); + return Utils.mapPage(inner, inner1 -> new DataConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + PagedIterable inner = + this.serviceClient().listByDatabase(resourceGroupName, workspaceName, kustoPoolName, databaseName, context); + return Utils.mapPage(inner, inner1 -> new DataConnectionImpl(inner1, this.manager())); + } + + public DataConnection get( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + DataConnectionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataConnection createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + DataConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + DataConnectionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + parameters, + context); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters) { + DataConnectionInner inner = + this + .serviceClient() + .update(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataConnection update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context) { + DataConnectionInner inner = + this + .serviceClient() + .update( + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + dataConnectionName, + parameters, + context); + if (inner != null) { + return new DataConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName); + } + + public void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, context); + } + + private DataConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabaseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabaseImpl.java new file mode 100644 index 0000000000000..9241d4564dcbb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabaseImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; +import com.azure.resourcemanager.synapse.models.Database; + +public final class DatabaseImpl implements Database { + private DatabaseInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + DatabaseImpl(DatabaseInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentImpl.java new file mode 100644 index 0000000000000..17d90cb695bcd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentImpl.java @@ -0,0 +1,223 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignment; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalRole; +import com.azure.resourcemanager.synapse.models.PrincipalType; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; + +public final class DatabasePrincipalAssignmentImpl + implements DatabasePrincipalAssignment, DatabasePrincipalAssignment.Definition, DatabasePrincipalAssignment.Update { + private DatabasePrincipalAssignmentInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public DatabasePrincipalRole role() { + return this.innerModel().role(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String tenantName() { + return this.innerModel().tenantName(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DatabasePrincipalAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + private String workspaceName; + + private String kustoPoolName; + + private String databaseName; + + private String principalAssignmentName; + + private String resourceGroupName; + + public DatabasePrincipalAssignmentImpl withExistingDatabase( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName) { + this.workspaceName = workspaceName; + this.kustoPoolName = kustoPoolName; + this.databaseName = databaseName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public DatabasePrincipalAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public DatabasePrincipalAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + DatabasePrincipalAssignmentImpl(String name, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = new DatabasePrincipalAssignmentInner(); + this.serviceManager = serviceManager; + this.principalAssignmentName = name; + } + + public DatabasePrincipalAssignmentImpl update() { + return this; + } + + public DatabasePrincipalAssignment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + Context.NONE); + return this; + } + + public DatabasePrincipalAssignment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .createOrUpdate( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + this.innerModel(), + context); + return this; + } + + DatabasePrincipalAssignmentImpl( + DatabasePrincipalAssignmentInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.kustoPoolName = Utils.getValueFromIdByName(innerObject.id(), "kustoPools"); + this.databaseName = Utils.getValueFromIdByName(innerObject.id(), "databases"); + this.principalAssignmentName = Utils.getValueFromIdByName(innerObject.id(), "principalAssignments"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public DatabasePrincipalAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .getWithResponse( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + Context.NONE) + .getValue(); + return this; + } + + public DatabasePrincipalAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabasePrincipalAssignments() + .getWithResponse( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context) + .getValue(); + return this; + } + + public DatabasePrincipalAssignmentImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public DatabasePrincipalAssignmentImpl withRole(DatabasePrincipalRole role) { + this.innerModel().withRole(role); + return this; + } + + public DatabasePrincipalAssignmentImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public DatabasePrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.innerModel().withPrincipalType(principalType); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsClientImpl.java new file mode 100644 index 0000000000000..771b5a4a8ecd1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsClientImpl.java @@ -0,0 +1,1582 @@ +// 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.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.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignmentListResult; +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 DatabasePrincipalAssignmentsClient. */ +public final class DatabasePrincipalAssignmentsClientImpl implements DatabasePrincipalAssignmentsClient { + private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatabasePrincipalAssignmentsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of DatabasePrincipalAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabasePrincipalAssignmentsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + DatabasePrincipalAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientDatabasePrincipalAssignments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface DatabasePrincipalAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}" + + "/checkPrincipalAssignmentNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/principalAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @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}/databases/{databaseName}/principalAssignments" + + "/{principalAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @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}/databases/{databaseName}/principalAssignments" + + "/{principalAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabasePrincipalAssignmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/principalAssignments" + + "/{principalAssignmentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + principalAssignmentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + principalAssignmentName, + accept, + context); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityWithResponseAsync( + workspaceName, kustoPoolName, databaseName, resourceGroupName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityAsync( + workspaceName, kustoPoolName, databaseName, resourceGroupName, principalAssignmentName) + .block(); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + workspaceName, kustoPoolName, databaseName, resourceGroupName, principalAssignmentName, context) + .block(); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String workspaceName, String kustoPoolName, String databaseName, 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String workspaceName, String kustoPoolName, String databaseName, 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(workspaceName, kustoPoolName, databaseName, resourceGroupName)); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(workspaceName, kustoPoolName, databaseName, resourceGroupName, context)); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName) { + return new PagedIterable<>(listAsync(workspaceName, kustoPoolName, databaseName, resourceGroupName)); + } + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(workspaceName, kustoPoolName, databaseName, resourceGroupName, context)); + } + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + return getWithResponseAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner get( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + return getAsync(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName).block(); + } + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return getWithResponseAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context) + .block(); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters) { + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabasePrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabasePrincipalAssignmentInner.class, + DatabasePrincipalAssignmentInner.class, + Context.NONE); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabasePrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabasePrincipalAssignmentInner.class, + DatabasePrincipalAssignmentInner.class, + context); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabasePrincipalAssignmentInner> + beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, parameters) + .getSyncPoller(); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabasePrincipalAssignmentInner> + beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, parameters) + .block(); + } + + /** + * Creates a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabasePrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + DatabasePrincipalAssignmentInner parameters, + Context context) { + return createOrUpdateAsync( + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + resourceGroupName, + parameters, + context) + .block(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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>> deleteWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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>> deleteWithResponseAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + 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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + databaseName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName) + .getSyncPoller(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return beginDeleteAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 deleteAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 deleteAsync( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return beginDeleteAsync( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + deleteAsync(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName).block(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + deleteAsync(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsImpl.java new file mode 100644 index 0000000000000..fb3812ba844e7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasePrincipalAssignmentsImpl.java @@ -0,0 +1,343 @@ +// 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.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignment; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.synapse.models.DatabasePrincipalAssignments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatabasePrincipalAssignmentsImpl implements DatabasePrincipalAssignments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentsImpl.class); + + private final DatabasePrincipalAssignmentsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public DatabasePrincipalAssignmentsImpl( + DatabasePrincipalAssignmentsClient innerClient, + com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName) { + CheckNameResultInner inner = + this + .serviceClient() + .checkNameAvailability( + workspaceName, kustoPoolName, databaseName, resourceGroupName, principalAssignmentName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + workspaceName, kustoPoolName, databaseName, resourceGroupName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(workspaceName, kustoPoolName, databaseName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DatabasePrincipalAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(workspaceName, kustoPoolName, databaseName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DatabasePrincipalAssignmentImpl(inner1, this.manager())); + } + + public DatabasePrincipalAssignment get( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + DatabasePrincipalAssignmentInner inner = + this + .serviceClient() + .get(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName); + if (inner != null) { + return new DatabasePrincipalAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabasePrincipalAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName) { + this + .serviceClient() + .delete(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName); + } + + public void delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + this + .serviceClient() + .delete(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context); + } + + public DatabasePrincipalAssignment 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 databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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, databaseName, principalAssignmentName, 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 databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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, databaseName, principalAssignmentName, 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 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 databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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))); + } + this + .delete( + workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, 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 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 databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + String principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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))); + } + this.delete(workspaceName, kustoPoolName, databaseName, principalAssignmentName, resourceGroupName, context); + } + + private DatabasePrincipalAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + public DatabasePrincipalAssignmentImpl define(String name) { + return new DatabasePrincipalAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesClientImpl.java new file mode 100644 index 0000000000000..7b063e2c53ff6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesClientImpl.java @@ -0,0 +1,1485 @@ +// 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.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.DatabasesClient; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; +import com.azure.resourcemanager.synapse.models.DatabaseListResult; +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 DatabasesClient. */ +public final class DatabasesClientImpl implements DatabasesClient { + private final ClientLogger logger = new ClientLogger(DatabasesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatabasesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of DatabasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabasesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(DatabasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientDatabases to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface DatabasesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByKustoPool( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @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}/databases/{databaseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @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}/databases/{databaseName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByKustoPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByKustoPool( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + this.client.getApiVersion(), + 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 list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByKustoPoolSinglePageAsync( + String resourceGroupName, String workspaceName, 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 (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 (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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByKustoPool( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKustoPoolAsync( + String resourceGroupName, String workspaceName, String kustoPoolName) { + return new PagedFlux<>(() -> listByKustoPoolSinglePageAsync(resourceGroupName, workspaceName, kustoPoolName)); + } + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByKustoPoolAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, Context context) { + return new PagedFlux<>( + () -> listByKustoPoolSinglePageAsync(resourceGroupName, workspaceName, kustoPoolName, context)); + } + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName) { + return new PagedIterable<>(listByKustoPoolAsync(resourceGroupName, workspaceName, kustoPoolName)); + } + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName, Context context) { + return new PagedIterable<>(listByKustoPoolAsync(resourceGroupName, workspaceName, kustoPoolName, context)); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return getWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner get( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return getAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).block(); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context).block(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, context); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .getSyncPoller(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).block(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .block(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatabaseInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, context); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return beginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .getSyncPoller(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatabaseInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return beginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + return updateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).block(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseInner update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + return updateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context).block(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + kustoPoolName, + databaseName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).getSyncPoller(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context).getSyncPoller(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + deleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).block(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + deleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesImpl.java new file mode 100644 index 0000000000000..db474fce247f2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DatabasesImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.DatabasesClient; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; +import com.azure.resourcemanager.synapse.models.Database; +import com.azure.resourcemanager.synapse.models.Databases; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatabasesImpl implements Databases { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasesImpl.class); + + private final DatabasesClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public DatabasesImpl(DatabasesClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName) { + PagedIterable inner = + this.serviceClient().listByKustoPool(resourceGroupName, workspaceName, kustoPoolName); + return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); + } + + public PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listByKustoPool(resourceGroupName, workspaceName, kustoPoolName, context); + return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager())); + } + + public Database get(String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + DatabaseInner inner = this.serviceClient().get(resourceGroupName, workspaceName, kustoPoolName, databaseName); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, kustoPoolName, databaseName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabaseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Database createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + DatabaseInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + DatabaseInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters) { + DatabaseInner inner = + this.serviceClient().update(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Database update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context) { + DatabaseInner inner = + this + .serviceClient() + .update(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, context); + if (inner != null) { + return new DatabaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName) { + this.serviceClient().delete(resourceGroupName, workspaceName, kustoPoolName, databaseName); + } + + public void delete( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, kustoPoolName, databaseName, context); + } + + private DatabasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/FollowerDatabaseDefinitionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/FollowerDatabaseDefinitionImpl.java new file mode 100644 index 0000000000000..dd697fc9d0417 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/FollowerDatabaseDefinitionImpl.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.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.models.FollowerDatabaseDefinition; + +public final class FollowerDatabaseDefinitionImpl implements FollowerDatabaseDefinition { + private FollowerDatabaseDefinitionInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + FollowerDatabaseDefinitionImpl( + FollowerDatabaseDefinitionInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String clusterResourceId() { + return this.innerModel().clusterResourceId(); + } + + public String attachedDatabaseConfigurationName() { + return this.innerModel().attachedDatabaseConfigurationName(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public FollowerDatabaseDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsClientImpl.java new file mode 100644 index 0000000000000..b832cfc56c683 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsClientImpl.java @@ -0,0 +1,269 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KustoOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.OperationInner; +import com.azure.resourcemanager.synapse.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in KustoOperationsClient. */ +public final class KustoOperationsClientImpl implements KustoOperationsClient { + private final ClientLogger logger = new ClientLogger(KustoOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KustoOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of KustoOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KustoOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(KustoOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientKustoOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface KustoOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Synapse/kustooperations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsImpl.java new file mode 100644 index 0000000000000..d9934090e46e8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoOperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KustoOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.OperationInner; +import com.azure.resourcemanager.synapse.models.KustoOperations; +import com.azure.resourcemanager.synapse.models.Operation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KustoOperationsImpl implements KustoOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoOperationsImpl.class); + + private final KustoOperationsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public KustoOperationsImpl( + KustoOperationsClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private KustoOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesClientImpl.java new file mode 100644 index 0000000000000..25e620abe1e39 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesClientImpl.java @@ -0,0 +1,268 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KustoPoolChildResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.models.DatabaseCheckNameRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in KustoPoolChildResourcesClient. */ +public final class KustoPoolChildResourcesClientImpl implements KustoPoolChildResourcesClient { + private final ClientLogger logger = new ClientLogger(KustoPoolChildResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KustoPoolChildResourcesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of KustoPoolChildResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KustoPoolChildResourcesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(KustoPoolChildResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientKustoPoolChildResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface KustoPoolChildResourcesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @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") DatabaseCheckNameRequest resourceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + DatabaseCheckNameRequest resourceName, + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + resourceName, + accept, + context); + } + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName) { + return checkNameAvailabilityWithResponseAsync(workspaceName, kustoPoolName, resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName) { + return checkNameAvailabilityAsync(workspaceName, kustoPoolName, resourceGroupName, resourceName).block(); + } + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + DatabaseCheckNameRequest resourceName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, resourceName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesImpl.java new file mode 100644 index 0000000000000..cdb919ccd80d3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolChildResourcesImpl.java @@ -0,0 +1,71 @@ +// 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.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.KustoPoolChildResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.DatabaseCheckNameRequest; +import com.azure.resourcemanager.synapse.models.KustoPoolChildResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KustoPoolChildResourcesImpl implements KustoPoolChildResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolChildResourcesImpl.class); + + private final KustoPoolChildResourcesClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public KustoPoolChildResourcesImpl( + KustoPoolChildResourcesClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName) { + CheckNameResultInner inner = + this.serviceClient().checkNameAvailability(workspaceName, kustoPoolName, resourceGroupName, resourceName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + DatabaseCheckNameRequest resourceName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + workspaceName, kustoPoolName, resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private KustoPoolChildResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..11cac27a767e9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolImpl.java @@ -0,0 +1,401 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; +import com.azure.resourcemanager.synapse.models.AzureSku; +import com.azure.resourcemanager.synapse.models.FollowerDatabaseDefinition; +import com.azure.resourcemanager.synapse.models.KustoPool; +import com.azure.resourcemanager.synapse.models.KustoPoolUpdate; +import com.azure.resourcemanager.synapse.models.LanguageExtension; +import com.azure.resourcemanager.synapse.models.LanguageExtensionsList; +import com.azure.resourcemanager.synapse.models.OptimizedAutoscale; +import com.azure.resourcemanager.synapse.models.ResourceProvisioningState; +import com.azure.resourcemanager.synapse.models.State; +import java.util.Collections; +import java.util.Map; + +public final class KustoPoolImpl implements KustoPool, KustoPool.Definition, KustoPool.Update { + private KustoPoolInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AzureSku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public State state() { + return this.innerModel().state(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String uri() { + return this.innerModel().uri(); + } + + public String dataIngestionUri() { + return this.innerModel().dataIngestionUri(); + } + + public String stateReason() { + return this.innerModel().stateReason(); + } + + public OptimizedAutoscale optimizedAutoscale() { + return this.innerModel().optimizedAutoscale(); + } + + public Boolean enableStreamingIngest() { + return this.innerModel().enableStreamingIngest(); + } + + public Boolean enablePurge() { + return this.innerModel().enablePurge(); + } + + public LanguageExtensionsList languageExtensions() { + return this.innerModel().languageExtensions(); + } + + public String workspaceUid() { + return this.innerModel().workspaceUid(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public KustoPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + private String workspaceName; + + private String resourceGroupName; + + private String kustoPoolName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + private KustoPoolUpdate updateParameters; + + public KustoPoolImpl withExistingWorkspace(String workspaceName, String resourceGroupName) { + this.workspaceName = workspaceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public KustoPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .createOrUpdate( + workspaceName, + resourceGroupName, + kustoPoolName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + Context.NONE); + return this; + } + + public KustoPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .createOrUpdate( + workspaceName, + resourceGroupName, + kustoPoolName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + context); + return this; + } + + KustoPoolImpl(String name, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = new KustoPoolInner(); + this.serviceManager = serviceManager; + this.kustoPoolName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public KustoPoolImpl update() { + this.updateIfMatch = null; + this.updateParameters = new KustoPoolUpdate(); + return this; + } + + public KustoPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .update(workspaceName, resourceGroupName, kustoPoolName, updateParameters, updateIfMatch, Context.NONE); + return this; + } + + public KustoPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .update(workspaceName, resourceGroupName, kustoPoolName, updateParameters, updateIfMatch, context); + return this; + } + + KustoPoolImpl(KustoPoolInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.kustoPoolName = Utils.getValueFromIdByName(innerObject.id(), "kustoPools"); + } + + public KustoPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .getWithResponse(workspaceName, kustoPoolName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public KustoPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKustoPoolsOperations() + .getWithResponse(workspaceName, kustoPoolName, resourceGroupName, context) + .getValue(); + return this; + } + + public void stop() { + serviceManager.kustoPoolsOperations().stop(workspaceName, kustoPoolName, resourceGroupName); + } + + public void stop(Context context) { + serviceManager.kustoPoolsOperations().stop(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public void start() { + serviceManager.kustoPoolsOperations().start(workspaceName, kustoPoolName, resourceGroupName); + } + + public void start(Context context) { + serviceManager.kustoPoolsOperations().start(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public PagedIterable listLanguageExtensions() { + return serviceManager + .kustoPoolsOperations() + .listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName); + } + + public PagedIterable listLanguageExtensions(Context context) { + return serviceManager + .kustoPoolsOperations() + .listLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd) { + serviceManager + .kustoPoolsOperations() + .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd); + } + + public void addLanguageExtensions(LanguageExtensionsList languageExtensionsToAdd, Context context) { + serviceManager + .kustoPoolsOperations() + .addLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToAdd, context); + } + + public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove) { + serviceManager + .kustoPoolsOperations() + .removeLanguageExtensions(workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove); + } + + public void removeLanguageExtensions(LanguageExtensionsList languageExtensionsToRemove, Context context) { + serviceManager + .kustoPoolsOperations() + .removeLanguageExtensions( + workspaceName, kustoPoolName, resourceGroupName, languageExtensionsToRemove, context); + } + + public PagedIterable listFollowerDatabases() { + return serviceManager + .kustoPoolsOperations() + .listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName); + } + + public PagedIterable listFollowerDatabases(Context context) { + return serviceManager + .kustoPoolsOperations() + .listFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, context); + } + + public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + serviceManager + .kustoPoolsOperations() + .detachFollowerDatabases(workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove); + } + + public void detachFollowerDatabases(FollowerDatabaseDefinitionInner followerDatabaseToRemove, Context context) { + serviceManager + .kustoPoolsOperations() + .detachFollowerDatabases( + workspaceName, kustoPoolName, resourceGroupName, followerDatabaseToRemove, context); + } + + public KustoPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KustoPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KustoPoolImpl withSku(AzureSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public KustoPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public KustoPoolImpl withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + if (isInCreateMode()) { + this.innerModel().withOptimizedAutoscale(optimizedAutoscale); + return this; + } else { + this.updateParameters.withOptimizedAutoscale(optimizedAutoscale); + return this; + } + } + + public KustoPoolImpl withEnableStreamingIngest(Boolean enableStreamingIngest) { + if (isInCreateMode()) { + this.innerModel().withEnableStreamingIngest(enableStreamingIngest); + return this; + } else { + this.updateParameters.withEnableStreamingIngest(enableStreamingIngest); + return this; + } + } + + public KustoPoolImpl withEnablePurge(Boolean enablePurge) { + if (isInCreateMode()) { + this.innerModel().withEnablePurge(enablePurge); + return this; + } else { + this.updateParameters.withEnablePurge(enablePurge); + return this; + } + } + + public KustoPoolImpl withWorkspaceUid(String workspaceUid) { + if (isInCreateMode()) { + this.innerModel().withWorkspaceUid(workspaceUid); + return this; + } else { + this.updateParameters.withWorkspaceUid(workspaceUid); + return this; + } + } + + public KustoPoolImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public KustoPoolImpl withIfNoneMatch(String ifNoneMatch) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolListResultImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolListResultImpl.java new file mode 100644 index 0000000000000..02e1a39a59154 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolListResultImpl.java @@ -0,0 +1,47 @@ +// 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.resourcemanager.synapse.fluent.models.KustoPoolInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; +import com.azure.resourcemanager.synapse.models.KustoPool; +import com.azure.resourcemanager.synapse.models.KustoPoolListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class KustoPoolListResultImpl implements KustoPoolListResult { + private KustoPoolListResultInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + KustoPoolListResultImpl( + KustoPoolListResultInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new KustoPoolImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public KustoPoolListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsClientImpl.java new file mode 100644 index 0000000000000..a7808e83cd19e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsClientImpl.java @@ -0,0 +1,1408 @@ +// 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.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.KustoPoolPrincipalAssignmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignmentListResult; +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 KustoPoolPrincipalAssignmentsClient. */ +public final class KustoPoolPrincipalAssignmentsClientImpl implements KustoPoolPrincipalAssignmentsClient { + private final ClientLogger logger = new ClientLogger(KustoPoolPrincipalAssignmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KustoPoolPrincipalAssignmentsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of KustoPoolPrincipalAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KustoPoolPrincipalAssignmentsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + KustoPoolPrincipalAssignmentsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientKustoPoolPrincipalAssignments to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface KustoPoolPrincipalAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/checkPrincipalAssignmentNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @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") ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/principalAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @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}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @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}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterPrincipalAssignmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/kustoPools/{kustoPoolName}/principalAssignments/{principalAssignmentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("workspaceName") String workspaceName, + @PathParam("kustoPoolName") String kustoPoolName, + @PathParam("principalAssignmentName") String principalAssignmentName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + principalAssignmentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } else { + principalAssignmentName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + principalAssignmentName, + accept, + context); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, principalAssignmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + return checkNameAvailabilityAsync(workspaceName, kustoPoolName, resourceGroupName, principalAssignmentName) + .block(); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + return checkNameAvailabilityWithResponseAsync( + workspaceName, kustoPoolName, resourceGroupName, principalAssignmentName, context) + .block(); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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())); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedFlux<>(() -> listSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName) { + return new PagedIterable<>(listAsync(workspaceName, kustoPoolName, resourceGroupName)); + } + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(workspaceName, kustoPoolName, resourceGroupName, context)); + } + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, String kustoPoolName, String principalAssignmentName, 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + return getWithResponseAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner get( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + return getAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName).block(); + } + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return getWithResponseAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context) + .block(); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters) { + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterPrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPrincipalAssignmentInner.class, + ClusterPrincipalAssignmentInner.class, + Context.NONE); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterPrincipalAssignmentInner> + beginCreateOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPrincipalAssignmentInner.class, + ClusterPrincipalAssignmentInner.class, + context); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters) + .getSyncPoller(); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterPrincipalAssignmentInner> beginCreateOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters) + .block(); + } + + /** + * Create a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters The Kusto pool principalAssignment's parameters supplied for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster principal assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPrincipalAssignmentInner createOrUpdate( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + ClusterPrincipalAssignmentInner parameters, + Context context) { + return createOrUpdateAsync( + workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, parameters, context) + .block(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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>> deleteWithResponseAsync( + String workspaceName, String kustoPoolName, String principalAssignmentName, 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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>> deleteWithResponseAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + 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 (principalAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter principalAssignmentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + principalAssignmentName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 PollerFlux, Void> beginDeleteAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName) + .getSyncPoller(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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) + public SyncPoller, Void> beginDelete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return beginDeleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 deleteAsync( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + return beginDeleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 deleteAsync( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + return beginDeleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + deleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName).block(); + } + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + deleteAsync(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsImpl.java new file mode 100644 index 0000000000000..8ef80ddd24d2b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolPrincipalAssignmentsImpl.java @@ -0,0 +1,290 @@ +// 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.KustoPoolPrincipalAssignmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; +import com.azure.resourcemanager.synapse.models.CheckNameResult; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignment; +import com.azure.resourcemanager.synapse.models.ClusterPrincipalAssignmentCheckNameRequest; +import com.azure.resourcemanager.synapse.models.KustoPoolPrincipalAssignments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KustoPoolPrincipalAssignmentsImpl implements KustoPoolPrincipalAssignments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolPrincipalAssignmentsImpl.class); + + private final KustoPoolPrincipalAssignmentsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public KustoPoolPrincipalAssignmentsImpl( + KustoPoolPrincipalAssignmentsClient innerClient, + com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName) { + CheckNameResultInner inner = + this + .serviceClient() + .checkNameAvailability(workspaceName, kustoPoolName, resourceGroupName, principalAssignmentName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + workspaceName, kustoPoolName, resourceGroupName, principalAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().list(workspaceName, kustoPoolName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ClusterPrincipalAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(workspaceName, kustoPoolName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ClusterPrincipalAssignmentImpl(inner1, this.manager())); + } + + public ClusterPrincipalAssignment get( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + ClusterPrincipalAssignmentInner inner = + this.serviceClient().get(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName); + if (inner != null) { + return new ClusterPrincipalAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterPrincipalAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName) { + this.serviceClient().delete(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName); + } + + public void delete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context) { + this.serviceClient().delete(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context); + } + + public ClusterPrincipalAssignment 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 principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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, principalAssignmentName, 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 principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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, principalAssignmentName, 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 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 principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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))); + } + this.delete(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, 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 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 principalAssignmentName = Utils.getValueFromIdByName(id, "principalAssignments"); + if (principalAssignmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'principalAssignments'.", + 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))); + } + this.delete(workspaceName, kustoPoolName, principalAssignmentName, resourceGroupName, context); + } + + private KustoPoolPrincipalAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } + + public ClusterPrincipalAssignmentImpl define(String name) { + return new ClusterPrincipalAssignmentImpl(name, this.manager()); + } +} 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 new file mode 100644 index 0000000000000..35e22a97e233d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KustoPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.SkuDescriptionList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in KustoPoolsClient. */ +public final class KustoPoolsClientImpl implements KustoPoolsClient { + private final ClientLogger logger = new ClientLogger(KustoPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KustoPoolsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of KustoPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KustoPoolsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(KustoPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientKustoPools to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface KustoPoolsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @throws ManagementException 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 the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @throws ManagementException 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 the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @throws ManagementException 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 the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the SKU descriptions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} 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 new file mode 100644 index 0000000000000..a463cb6105ca1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KustoPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.KustoPools; +import com.azure.resourcemanager.synapse.models.SkuDescription; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KustoPoolsImpl implements KustoPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolsImpl.class); + + private final KustoPoolsClient innerClient; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + public KustoPoolsImpl( + KustoPoolsClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SkuDescriptionImpl(inner1, this.manager())); + } + + private KustoPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..33dcffe0e0bc8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsClientImpl.java @@ -0,0 +1,3884 @@ +// 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + ifNoneMatch, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + ifNoneMatch, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + ifMatch, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + workspaceName, + resourceGroupName, + kustoPoolName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkusByResource( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkusByResource( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .addLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .addLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .removeLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .removeLanguageExtensions( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFollowerDatabases( + this.client.getEndpoint(), + workspaceName, + kustoPoolName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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.SINGLE) + 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 new file mode 100644 index 0000000000000..ff07081691800 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsOperationsImpl.java @@ -0,0 +1,361 @@ +// 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/LanguageExtensionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LanguageExtensionImpl.java new file mode 100644 index 0000000000000..b25223cf20d3b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LanguageExtensionImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.synapse.models.LanguageExtension; +import com.azure.resourcemanager.synapse.models.LanguageExtensionName; + +public final class LanguageExtensionImpl implements LanguageExtension { + private LanguageExtensionInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + LanguageExtensionImpl( + LanguageExtensionInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LanguageExtensionName languageExtensionName() { + return this.innerModel().languageExtensionName(); + } + + public LanguageExtensionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationImpl.java new file mode 100644 index 0000000000000..9891facd54790 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.OperationInner; +import com.azure.resourcemanager.synapse.models.Operation; +import com.azure.resourcemanager.synapse.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java index 67e4b452db13a..94c55b12adf81 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java @@ -82,6 +82,22 @@ Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -277,6 +293,179 @@ public PagedIterable list( return new PagedIterable<>(listAsync(resourceGroupName, privateLinkHubName, context)); } + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionForPrivateLinkHubInner get( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName).block(); + } + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName, context) + .block(); + } + /** * Get the next page of items. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java index bfc7787f4ae9d..bb3d4c0a3b91f 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java @@ -5,6 +5,8 @@ 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.PrivateEndpointConnectionsPrivateLinkHubsClient; @@ -44,6 +46,34 @@ public PagedIterable list( .mapPage(inner, inner1 -> new PrivateEndpointConnectionForPrivateLinkHubImpl(inner1, this.manager())); } + public PrivateEndpointConnectionForPrivateLinkHub get( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName) { + PrivateEndpointConnectionForPrivateLinkHubInner inner = + this.serviceClient().get(resourceGroupName, privateLinkHubName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionForPrivateLinkHubImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateLinkHubName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionForPrivateLinkHubImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + private PrivateEndpointConnectionsPrivateLinkHubsClient serviceClient() { return this.innerClient; } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SkuDescriptionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SkuDescriptionImpl.java new file mode 100644 index 0000000000000..590325353790e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SkuDescriptionImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.azure.resourcemanager.synapse.models.SkuDescription; +import com.azure.resourcemanager.synapse.models.SkuLocationInfoItem; +import java.util.Collections; +import java.util.List; + +public final class SkuDescriptionImpl implements SkuDescription { + private SkuDescriptionInner innerObject; + + private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; + + SkuDescriptionImpl( + SkuDescriptionInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String size() { + return this.innerModel().size(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.synapse.SynapseManager manager() { + return this.serviceManager; + } +} 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 b05f6fe9f364e..ffedf6bb8036f 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 @@ -21,9 +21,13 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.synapse.fluent.AttachedDatabaseConfigurationsClient; import com.azure.resourcemanager.synapse.fluent.BigDataPoolsClient; +import com.azure.resourcemanager.synapse.fluent.DataConnectionsClient; import com.azure.resourcemanager.synapse.fluent.DataMaskingPoliciesClient; import com.azure.resourcemanager.synapse.fluent.DataMaskingRulesClient; +import com.azure.resourcemanager.synapse.fluent.DatabasePrincipalAssignmentsClient; +import com.azure.resourcemanager.synapse.fluent.DatabasesClient; import com.azure.resourcemanager.synapse.fluent.ExtendedSqlPoolBlobAuditingPoliciesClient; import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeAuthKeysOperationsClient; import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeConnectionInfosClient; @@ -36,6 +40,11 @@ import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimesClient; import com.azure.resourcemanager.synapse.fluent.IpFirewallRulesClient; import com.azure.resourcemanager.synapse.fluent.KeysClient; +import com.azure.resourcemanager.synapse.fluent.KustoOperationsClient; +import com.azure.resourcemanager.synapse.fluent.KustoPoolChildResourcesClient; +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; @@ -326,6 +335,114 @@ public KeysClient getKeys() { return this.keys; } + /** The KustoOperationsClient object to access its operations. */ + private final KustoOperationsClient kustoOperations; + + /** + * Gets the KustoOperationsClient object to access its operations. + * + * @return the KustoOperationsClient object. + */ + public KustoOperationsClient getKustoOperations() { + return this.kustoOperations; + } + + /** The KustoPoolsClient object to access its operations. */ + private final KustoPoolsClient kustoPools; + + /** + * Gets the KustoPoolsClient object to access its operations. + * + * @return the KustoPoolsClient object. + */ + 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; + + /** + * Gets the KustoPoolChildResourcesClient object to access its operations. + * + * @return the KustoPoolChildResourcesClient object. + */ + public KustoPoolChildResourcesClient getKustoPoolChildResources() { + return this.kustoPoolChildResources; + } + + /** The AttachedDatabaseConfigurationsClient object to access its operations. */ + private final AttachedDatabaseConfigurationsClient attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + public AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + + /** The DatabasesClient object to access its operations. */ + private final DatabasesClient databases; + + /** + * Gets the DatabasesClient object to access its operations. + * + * @return the DatabasesClient object. + */ + public DatabasesClient getDatabases() { + return this.databases; + } + + /** The DataConnectionsClient object to access its operations. */ + private final DataConnectionsClient dataConnections; + + /** + * Gets the DataConnectionsClient object to access its operations. + * + * @return the DataConnectionsClient object. + */ + public DataConnectionsClient getDataConnections() { + return this.dataConnections; + } + + /** The KustoPoolPrincipalAssignmentsClient object to access its operations. */ + private final KustoPoolPrincipalAssignmentsClient kustoPoolPrincipalAssignments; + + /** + * Gets the KustoPoolPrincipalAssignmentsClient object to access its operations. + * + * @return the KustoPoolPrincipalAssignmentsClient object. + */ + public KustoPoolPrincipalAssignmentsClient getKustoPoolPrincipalAssignments() { + return this.kustoPoolPrincipalAssignments; + } + + /** The DatabasePrincipalAssignmentsClient object to access its operations. */ + private final DatabasePrincipalAssignmentsClient databasePrincipalAssignments; + + /** + * Gets the DatabasePrincipalAssignmentsClient object to access its operations. + * + * @return the DatabasePrincipalAssignmentsClient object. + */ + public DatabasePrincipalAssignmentsClient getDatabasePrincipalAssignments() { + return this.databasePrincipalAssignments; + } + /** The LibrariesClient object to access its operations. */ private final LibrariesClient libraries; @@ -928,7 +1045,7 @@ public RestorableDroppedSqlPoolsClient getRestorableDroppedSqlPools() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2021-06-01-preview"; this.bigDataPools = new BigDataPoolsClientImpl(this); this.operations = new OperationsClientImpl(this); this.ipFirewallRules = new IpFirewallRulesClientImpl(this); @@ -942,6 +1059,15 @@ public RestorableDroppedSqlPoolsClient getRestorableDroppedSqlPools() { this.integrationRuntimeMonitoringDatas = new IntegrationRuntimeMonitoringDatasClientImpl(this); this.integrationRuntimeStatusOperations = new IntegrationRuntimeStatusOperationsClientImpl(this); this.keys = new KeysClientImpl(this); + this.kustoOperations = new KustoOperationsClientImpl(this); + this.kustoPools = new KustoPoolsClientImpl(this); + this.kustoPoolsOperations = new KustoPoolsOperationsClientImpl(this); + this.kustoPoolChildResources = new KustoPoolChildResourcesClientImpl(this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsClientImpl(this); + this.databases = new DatabasesClientImpl(this); + this.dataConnections = new DataConnectionsClientImpl(this); + this.kustoPoolPrincipalAssignments = new KustoPoolPrincipalAssignmentsClientImpl(this); + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsClientImpl(this); this.libraries = new LibrariesClientImpl(this); this.librariesOperations = new LibrariesOperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java index 53ba61397c4c0..8219574bd6f4c 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java @@ -8,6 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.synapse.models.CspWorkspaceAdminProperties; import com.azure.resourcemanager.synapse.models.DataLakeStorageAccountDetails; import com.azure.resourcemanager.synapse.models.EncryptionDetails; import com.azure.resourcemanager.synapse.models.ManagedIdentity; @@ -147,6 +148,10 @@ public WorkspacePublicNetworkAccess publicNetworkAccess() { return this.innerModel().publicNetworkAccess(); } + public CspWorkspaceAdminProperties cspWorkspaceAdminProperties() { + return this.innerModel().cspWorkspaceAdminProperties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -376,6 +381,11 @@ public WorkspaceImpl withPublicNetworkAccess(WorkspacePublicNetworkAccess public } } + public WorkspaceImpl withCspWorkspaceAdminProperties(CspWorkspaceAdminProperties cspWorkspaceAdminProperties) { + this.innerModel().withCspWorkspaceAdminProperties(cspWorkspaceAdminProperties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfiguration.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfiguration.java new file mode 100644 index 0000000000000..1ac77e6e68f83 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfiguration.java @@ -0,0 +1,323 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of AttachedDatabaseConfiguration. */ +public interface AttachedDatabaseConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the databaseName property: The name of the database which you would like to attach, use * if you want to + * follow all current and future databases. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the clusterResourceId property: The resource id of the kusto pool where the databases you would like to + * attach reside. + * + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * Gets the attachedDatabaseNames property: The list of databases from the clusterResourceId which are currently + * attached to the kusto pool. + * + * @return the attachedDatabaseNames value. + */ + List attachedDatabaseNames(); + + /** + * Gets the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @return the defaultPrincipalsModificationKind value. + */ + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind(); + + /** + * Gets the tableLevelSharingProperties property: Table level sharing specifications. + * + * @return the tableLevelSharingProperties value. + */ + TableLevelSharingProperties tableLevelSharingProperties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner object. + * + * @return the inner object. + */ + AttachedDatabaseConfigurationInner innerModel(); + + /** The entirety of the AttachedDatabaseConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AttachedDatabaseConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the AttachedDatabaseConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies workspaceName, kustoPoolName, resourceGroupName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingKustoPool(String workspaceName, String kustoPoolName, String resourceGroupName); + } + /** + * The stage of the AttachedDatabaseConfiguration definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithDatabaseName, + DefinitionStages.WithClusterResourceId, + DefinitionStages.WithDefaultPrincipalsModificationKind, + DefinitionStages.WithTableLevelSharingProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AttachedDatabaseConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AttachedDatabaseConfiguration create(Context context); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify databaseName. */ + interface WithDatabaseName { + /** + * Specifies the databaseName property: The name of the database which you would like to attach, use * if + * you want to follow all current and future databases.. + * + * @param databaseName The name of the database which you would like to attach, use * if you want to follow + * all current and future databases. + * @return the next definition stage. + */ + WithCreate withDatabaseName(String databaseName); + } + /** The stage of the AttachedDatabaseConfiguration definition allowing to specify clusterResourceId. */ + interface WithClusterResourceId { + /** + * Specifies the clusterResourceId property: The resource id of the kusto pool where the databases you would + * like to attach reside.. + * + * @param clusterResourceId The resource id of the kusto pool where the databases you would like to attach + * reside. + * @return the next definition stage. + */ + WithCreate withClusterResourceId(String clusterResourceId); + } + /** + * The stage of the AttachedDatabaseConfiguration definition allowing to specify + * defaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind The default principals modification kind. + * @return the next definition stage. + */ + WithCreate withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + /** + * The stage of the AttachedDatabaseConfiguration definition allowing to specify tableLevelSharingProperties. + */ + interface WithTableLevelSharingProperties { + /** + * Specifies the tableLevelSharingProperties property: Table level sharing specifications. + * + * @param tableLevelSharingProperties Table level sharing specifications. + * @return the next definition stage. + */ + WithCreate withTableLevelSharingProperties(TableLevelSharingProperties tableLevelSharingProperties); + } + } + /** + * Begins update for the AttachedDatabaseConfiguration resource. + * + * @return the stage of resource update. + */ + AttachedDatabaseConfiguration.Update update(); + + /** The template for AttachedDatabaseConfiguration update. */ + interface Update + extends UpdateStages.WithDatabaseName, + UpdateStages.WithClusterResourceId, + UpdateStages.WithDefaultPrincipalsModificationKind, + UpdateStages.WithTableLevelSharingProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AttachedDatabaseConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AttachedDatabaseConfiguration apply(Context context); + } + /** The AttachedDatabaseConfiguration update stages. */ + interface UpdateStages { + /** The stage of the AttachedDatabaseConfiguration update allowing to specify databaseName. */ + interface WithDatabaseName { + /** + * Specifies the databaseName property: The name of the database which you would like to attach, use * if + * you want to follow all current and future databases.. + * + * @param databaseName The name of the database which you would like to attach, use * if you want to follow + * all current and future databases. + * @return the next definition stage. + */ + Update withDatabaseName(String databaseName); + } + /** The stage of the AttachedDatabaseConfiguration update allowing to specify clusterResourceId. */ + interface WithClusterResourceId { + /** + * Specifies the clusterResourceId property: The resource id of the kusto pool where the databases you would + * like to attach reside.. + * + * @param clusterResourceId The resource id of the kusto pool where the databases you would like to attach + * reside. + * @return the next definition stage. + */ + Update withClusterResourceId(String clusterResourceId); + } + /** + * The stage of the AttachedDatabaseConfiguration update allowing to specify defaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies the defaultPrincipalsModificationKind property: The default principals modification kind. + * + * @param defaultPrincipalsModificationKind The default principals modification kind. + * @return the next definition stage. + */ + Update withDefaultPrincipalsModificationKind( + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + /** The stage of the AttachedDatabaseConfiguration update allowing to specify tableLevelSharingProperties. */ + interface WithTableLevelSharingProperties { + /** + * Specifies the tableLevelSharingProperties property: Table level sharing specifications. + * + * @param tableLevelSharingProperties Table level sharing specifications. + * @return the next definition stage. + */ + Update withTableLevelSharingProperties(TableLevelSharingProperties tableLevelSharingProperties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AttachedDatabaseConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AttachedDatabaseConfiguration refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurationListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurationListResult.java new file mode 100644 index 0000000000000..a9388b68510eb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurationListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.AttachedDatabaseConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list attached database configurations operation response. */ +@Fluent +public final class AttachedDatabaseConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationListResult.class); + + /* + * The list of attached database configurations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of attached database configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of attached database configurations. + * + * @param value the value value to set. + * @return the AttachedDatabaseConfigurationListResult object itself. + */ + public AttachedDatabaseConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurations.java new file mode 100644 index 0000000000000..5f4aea3b4613f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AttachedDatabaseConfigurations.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AttachedDatabaseConfigurations. */ +public interface AttachedDatabaseConfigurations { + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Returns the list of attached database configurations of the given 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 attached database configurations operation response. + */ + PagedIterable listByKustoPool( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + AttachedDatabaseConfiguration get( + String workspaceName, String kustoPoolName, String attachedDatabaseConfigurationName, String resourceGroupName); + + /** + * Returns an attached database configuration. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 class representing an attached database configuration. + */ + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, String kustoPoolName, String attachedDatabaseConfigurationName, String resourceGroupName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @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 delete( + String workspaceName, + String kustoPoolName, + String attachedDatabaseConfigurationName, + String resourceGroupName, + Context context); + + /** + * Returns an attached database configuration. + * + * @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 class representing an attached database configuration. + */ + AttachedDatabaseConfiguration getById(String id); + + /** + * Returns an attached database configuration. + * + * @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 class representing an attached database configuration. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the attached database configuration with the given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the attached database configuration with the given name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AttachedDatabaseConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new AttachedDatabaseConfiguration definition. + */ + AttachedDatabaseConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureCapacity.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureCapacity.java new file mode 100644 index 0000000000000..9717c6fb7906c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureCapacity.java @@ -0,0 +1,133 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure capacity definition. */ +@Fluent +public final class AzureCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureCapacity.class); + + /* + * Scale type. + */ + @JsonProperty(value = "scaleType", required = true) + private AzureScaleType scaleType; + + /* + * Minimum allowed capacity. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Maximum allowed capacity. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /* + * The default capacity that would be used. + */ + @JsonProperty(value = "default", required = true) + private int defaultProperty; + + /** + * Get the scaleType property: Scale type. + * + * @return the scaleType value. + */ + public AzureScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: Scale type. + * + * @param scaleType the scaleType value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withScaleType(AzureScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Get the minimum property: Minimum allowed capacity. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Minimum allowed capacity. + * + * @param minimum the minimum value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Maximum allowed capacity. + * + * @return the maximum value. + */ + public int maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Maximum allowed capacity. + * + * @param maximum the maximum value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: The default capacity that would be used. + * + * @return the defaultProperty value. + */ + public int defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default capacity that would be used. + * + * @param defaultProperty the defaultProperty value to set. + * @return the AzureCapacity object itself. + */ + public AzureCapacity withDefaultProperty(int defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property scaleType in model AzureCapacity")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureResourceSku.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureResourceSku.java new file mode 100644 index 0000000000000..3b9b289d0aed3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureResourceSku.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; + +/** An immutable client-side representation of AzureResourceSku. */ +public interface AzureResourceSku { + /** + * Gets the resourceType property: Resource Namespace and Type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the sku property: The SKU details. + * + * @return the sku value. + */ + AzureSku sku(); + + /** + * Gets the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + AzureCapacity capacity(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner object. + * + * @return the inner object. + */ + AzureResourceSkuInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureScaleType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureScaleType.java new file mode 100644 index 0000000000000..2ece6db532d9e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureScaleType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureScaleType. */ +public final class AzureScaleType extends ExpandableStringEnum { + /** Static value automatic for AzureScaleType. */ + public static final AzureScaleType AUTOMATIC = fromString("automatic"); + + /** Static value manual for AzureScaleType. */ + public static final AzureScaleType MANUAL = fromString("manual"); + + /** Static value none for AzureScaleType. */ + public static final AzureScaleType NONE = fromString("none"); + + /** + * Creates or finds a AzureScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureScaleType. + */ + @JsonCreator + public static AzureScaleType fromString(String name) { + return fromString(name, AzureScaleType.class); + } + + /** @return known AzureScaleType values. */ + public static Collection values() { + return values(AzureScaleType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureSku.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureSku.java new file mode 100644 index 0000000000000..182fac137c6b2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureSku.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure SKU definition. */ +@Fluent +public final class AzureSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSku.class); + + /* + * SKU name. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /* + * SKU size. + */ + @JsonProperty(value = "size", required = true) + private SkuSize size; + + /** + * Get the name property: SKU name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: SKU name. + * + * @param name the name value to set. + * @return the AzureSku object itself. + */ + public AzureSku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the capacity property: The number of instances of the cluster. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The number of instances of the cluster. + * + * @param capacity the capacity value to set. + * @return the AzureSku object itself. + */ + public AzureSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the size property: SKU size. + * + * @return the size value. + */ + public SkuSize size() { + return this.size; + } + + /** + * Set the size property: SKU size. + * + * @param size the size value to set. + * @return the AzureSku object itself. + */ + public AzureSku withSize(SkuSize size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model AzureSku")); + } + if (size() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property size in model AzureSku")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java index fa47655eb37c2..79458ecbc2ffd 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class BigDataPoolPatchInfo { * Updated tags for the Big Data pool */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java index 36e90df50332e..494359a6d822c 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java @@ -56,7 +56,7 @@ public interface BigDataPoolResourceInfo { String provisioningState(); /** - * Gets the autoScale property: Auto-scaling properties. + * Gets the autoScale property: Spark pool auto-scaling properties Auto-scaling properties. * * @return the autoScale value. */ @@ -70,7 +70,7 @@ public interface BigDataPoolResourceInfo { OffsetDateTime creationDate(); /** - * Gets the autoPause property: Auto-pausing properties. + * Gets the autoPause property: Spark pool auto-pausing properties Auto-pausing properties. * * @return the autoPause value. */ @@ -119,7 +119,7 @@ public interface BigDataPoolResourceInfo { Integer nodeCount(); /** - * Gets the libraryRequirements property: Library version requirements. + * Gets the libraryRequirements property: Spark pool library version requirements Library version requirements. * * @return the libraryRequirements value. */ @@ -133,7 +133,8 @@ public interface BigDataPoolResourceInfo { List customLibraries(); /** - * Gets the sparkConfigProperties property: Spark configuration file to specify additional properties. + * Gets the sparkConfigProperties property: Spark pool library version requirements Spark configuration file to + * specify additional properties. * * @return the sparkConfigProperties value. */ @@ -298,9 +299,9 @@ interface WithProvisioningState { /** The stage of the BigDataPoolResourceInfo definition allowing to specify autoScale. */ interface WithAutoScale { /** - * Specifies the autoScale property: Auto-scaling properties. + * Specifies the autoScale property: Spark pool auto-scaling properties Auto-scaling properties. * - * @param autoScale Auto-scaling properties. + * @param autoScale Spark pool auto-scaling properties Auto-scaling properties. * @return the next definition stage. */ WithCreate withAutoScale(AutoScaleProperties autoScale); @@ -318,9 +319,9 @@ interface WithCreationDate { /** The stage of the BigDataPoolResourceInfo definition allowing to specify autoPause. */ interface WithAutoPause { /** - * Specifies the autoPause property: Auto-pausing properties. + * Specifies the autoPause property: Spark pool auto-pausing properties Auto-pausing properties. * - * @param autoPause Auto-pausing properties. + * @param autoPause Spark pool auto-pausing properties Auto-pausing properties. * @return the next definition stage. */ WithCreate withAutoPause(AutoPauseProperties autoPause); @@ -388,9 +389,10 @@ interface WithNodeCount { /** The stage of the BigDataPoolResourceInfo definition allowing to specify libraryRequirements. */ interface WithLibraryRequirements { /** - * Specifies the libraryRequirements property: Library version requirements. + * Specifies the libraryRequirements property: Spark pool library version requirements Library version + * requirements. * - * @param libraryRequirements Library version requirements. + * @param libraryRequirements Spark pool library version requirements Library version requirements. * @return the next definition stage. */ WithCreate withLibraryRequirements(LibraryRequirements libraryRequirements); @@ -409,9 +411,11 @@ interface WithCustomLibraries { /** The stage of the BigDataPoolResourceInfo definition allowing to specify sparkConfigProperties. */ interface WithSparkConfigProperties { /** - * Specifies the sparkConfigProperties property: Spark configuration file to specify additional properties. + * Specifies the sparkConfigProperties property: Spark pool library version requirements Spark configuration + * file to specify additional properties. * - * @param sparkConfigProperties Spark configuration file to specify additional properties. + * @param sparkConfigProperties Spark pool library version requirements Spark configuration file to specify + * additional properties. * @return the next definition stage. */ WithCreate withSparkConfigProperties(LibraryRequirements sparkConfigProperties); diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobStorageEventType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobStorageEventType.java new file mode 100644 index 0000000000000..e6b899a60781f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobStorageEventType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobStorageEventType. */ +public final class BlobStorageEventType extends ExpandableStringEnum { + /** Static value Microsoft.Storage.BlobCreated for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_CREATED = + fromString("Microsoft.Storage.BlobCreated"); + + /** Static value Microsoft.Storage.BlobRenamed for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_RENAMED = + fromString("Microsoft.Storage.BlobRenamed"); + + /** + * Creates or finds a BlobStorageEventType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobStorageEventType. + */ + @JsonCreator + public static BlobStorageEventType fromString(String name) { + return fromString(name, BlobStorageEventType.class); + } + + /** @return known BlobStorageEventType values. */ + public static Collection values() { + return values(BlobStorageEventType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameResult.java new file mode 100644 index 0000000000000..28cccea7dbe44 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameResult.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner; + +/** An immutable client-side representation of CheckNameResult. */ +public interface CheckNameResult { + /** + * Gets the nameAvailable property: Specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the name property: The name that was checked. + * + * @return the name value. + */ + String name(); + + /** + * Gets the message property: Message indicating an unavailable name due to a conflict, or a description of the + * naming rules that are violated. + * + * @return the message value. + */ + String message(); + + /** + * Gets the reason property: Message providing the reason why the given name is invalid. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.CheckNameResultInner object. + * + * @return the inner object. + */ + CheckNameResultInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignment.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignment.java new file mode 100644 index 0000000000000..083a775c114db --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignment.java @@ -0,0 +1,273 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; + +/** An immutable client-side representation of ClusterPrincipalAssignment. */ +public interface ClusterPrincipalAssignment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the principalId property: The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the role property: Cluster principal role. + * + * @return the role value. + */ + ClusterPrincipalRole role(); + + /** + * Gets the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the principalType property: Principal type. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + String tenantName(); + + /** + * Gets the principalName property: The principal name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner object. + * + * @return the inner object. + */ + ClusterPrincipalAssignmentInner innerModel(); + + /** The entirety of the ClusterPrincipalAssignment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ClusterPrincipalAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the ClusterPrincipalAssignment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies workspaceName, kustoPoolName, resourceGroupName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingKustoPool(String workspaceName, String kustoPoolName, String resourceGroupName); + } + /** + * The stage of the ClusterPrincipalAssignment definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrincipalId, + DefinitionStages.WithRole, + DefinitionStages.WithTenantId, + DefinitionStages.WithPrincipalType { + /** + * Executes the create request. + * + * @return the created resource. + */ + ClusterPrincipalAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ClusterPrincipalAssignment create(Context context); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Cluster principal role.. + * + * @param role Cluster principal role. + * @return the next definition stage. + */ + WithCreate withRole(ClusterPrincipalRole role); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the ClusterPrincipalAssignment definition allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + } + /** + * Begins update for the ClusterPrincipalAssignment resource. + * + * @return the stage of resource update. + */ + ClusterPrincipalAssignment.Update update(); + + /** The template for ClusterPrincipalAssignment update. */ + interface Update + extends UpdateStages.WithPrincipalId, + UpdateStages.WithRole, + UpdateStages.WithTenantId, + UpdateStages.WithPrincipalType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ClusterPrincipalAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ClusterPrincipalAssignment apply(Context context); + } + /** The ClusterPrincipalAssignment update stages. */ + interface UpdateStages { + /** The stage of the ClusterPrincipalAssignment update allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the cluster principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + Update withPrincipalId(String principalId); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Cluster principal role.. + * + * @param role Cluster principal role. + * @return the next definition stage. + */ + Update withRole(ClusterPrincipalRole role); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the ClusterPrincipalAssignment update allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + Update withPrincipalType(PrincipalType principalType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ClusterPrincipalAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ClusterPrincipalAssignment refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentCheckNameRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentCheckNameRequest.java new file mode 100644 index 0000000000000..23f04d0269b4a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentCheckNameRequest.java @@ -0,0 +1,88 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A principal assignment check name availability request. */ +@Fluent +public final class ClusterPrincipalAssignmentCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentCheckNameRequest.class); + + /* + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, + * Microsoft.Synapse/workspaces/kustoPools/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of ClusterPrincipalAssignmentCheckNameRequest class. */ + public ClusterPrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Synapse/workspaces/kustoPools/principalAssignments"; + } + + /** + * Get the name property: Principal Assignment resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Principal Assignment resource name. + * + * @param name the name value to set. + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools/principalAssignments. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools/principalAssignments. + * + * @param type the type value to set. + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ClusterPrincipalAssignmentCheckNameRequest")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentListResult.java new file mode 100644 index 0000000000000..c1d7b9d0e1781 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalAssignmentListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ClusterPrincipalAssignmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto cluster principal assignments operation response. */ +@Fluent +public final class ClusterPrincipalAssignmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPrincipalAssignmentListResult.class); + + /* + * The list of Kusto cluster principal assignments. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto cluster principal assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto cluster principal assignments. + * + * @param value the value value to set. + * @return the ClusterPrincipalAssignmentListResult object itself. + */ + public ClusterPrincipalAssignmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalRole.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalRole.java new file mode 100644 index 0000000000000..6b5dc49d1cb6d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ClusterPrincipalRole.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterPrincipalRole. */ +public final class ClusterPrincipalRole extends ExpandableStringEnum { + /** Static value AllDatabasesAdmin for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_ADMIN = fromString("AllDatabasesAdmin"); + + /** Static value AllDatabasesViewer for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_VIEWER = fromString("AllDatabasesViewer"); + + /** + * Creates or finds a ClusterPrincipalRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterPrincipalRole. + */ + @JsonCreator + public static ClusterPrincipalRole fromString(String name) { + return fromString(name, ClusterPrincipalRole.class); + } + + /** @return known ClusterPrincipalRole values. */ + public static Collection values() { + return values(ClusterPrincipalRole.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Compression.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Compression.java new file mode 100644 index 0000000000000..5b9921737f1e6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Compression.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Compression. */ +public final class Compression extends ExpandableStringEnum { + /** Static value None for Compression. */ + public static final Compression NONE = fromString("None"); + + /** Static value GZip for Compression. */ + public static final Compression GZIP = fromString("GZip"); + + /** + * Creates or finds a Compression from its string representation. + * + * @param name a name to look for. + * @return the corresponding Compression. + */ + @JsonCreator + public static Compression fromString(String name) { + return fromString(name, Compression.class); + } + + /** @return known Compression values. */ + public static Collection values() { + return values(Compression.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CspWorkspaceAdminProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CspWorkspaceAdminProperties.java new file mode 100644 index 0000000000000..385c71a19e30a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CspWorkspaceAdminProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Initial workspace AAD admin properties for a CSP subscription. */ +@Fluent +public final class CspWorkspaceAdminProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CspWorkspaceAdminProperties.class); + + /* + * AAD object ID of initial workspace admin + */ + @JsonProperty(value = "initialWorkspaceAdminObjectId") + private String initialWorkspaceAdminObjectId; + + /** + * Get the initialWorkspaceAdminObjectId property: AAD object ID of initial workspace admin. + * + * @return the initialWorkspaceAdminObjectId value. + */ + public String initialWorkspaceAdminObjectId() { + return this.initialWorkspaceAdminObjectId; + } + + /** + * Set the initialWorkspaceAdminObjectId property: AAD object ID of initial workspace admin. + * + * @param initialWorkspaceAdminObjectId the initialWorkspaceAdminObjectId value to set. + * @return the CspWorkspaceAdminProperties object itself. + */ + public CspWorkspaceAdminProperties withInitialWorkspaceAdminObjectId(String initialWorkspaceAdminObjectId) { + this.initialWorkspaceAdminObjectId = initialWorkspaceAdminObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java index 02d3c10a330cf..5da6207d67e81 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java @@ -26,6 +26,12 @@ public final class CustomerManagedKeyDetails { @JsonProperty(value = "key") private WorkspaceKeyDetails key; + /* + * Key encryption key + */ + @JsonProperty(value = "kekIdentity") + private KekIdentityProperties kekIdentity; + /** * Get the status property: The customer managed key status on the workspace. * @@ -55,6 +61,26 @@ public CustomerManagedKeyDetails withKey(WorkspaceKeyDetails key) { return this; } + /** + * Get the kekIdentity property: Key encryption key. + * + * @return the kekIdentity value. + */ + public KekIdentityProperties kekIdentity() { + return this.kekIdentity; + } + + /** + * Set the kekIdentity property: Key encryption key. + * + * @param kekIdentity the kekIdentity value to set. + * @return the CustomerManagedKeyDetails object itself. + */ + public CustomerManagedKeyDetails withKekIdentity(KekIdentityProperties kekIdentity) { + this.kekIdentity = kekIdentity; + return this; + } + /** * Validates the instance. * @@ -64,5 +90,8 @@ public void validate() { if (key() != null) { key().validate(); } + if (kekIdentity() != null) { + kekIdentity().validate(); + } } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnection.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnection.java new file mode 100644 index 0000000000000..1aad365bb7071 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnection.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; + +/** An immutable client-side representation of DataConnection. */ +public interface DataConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner object. + * + * @return the inner object. + */ + DataConnectionInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionCheckNameRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionCheckNameRequest.java new file mode 100644 index 0000000000000..7691406fc1279 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionCheckNameRequest.java @@ -0,0 +1,88 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A data connection check name availability request. */ +@Fluent +public final class DataConnectionCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionCheckNameRequest.class); + + /* + * Data Connection name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, + * Microsoft.Synapse/workspaces/kustoPools/databases/dataConnections. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of DataConnectionCheckNameRequest class. */ + public DataConnectionCheckNameRequest() { + type = "Microsoft.Synapse/workspaces/kustoPools/databases/dataConnections"; + } + + /** + * Get the name property: Data Connection name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Data Connection name. + * + * @param name the name value to set. + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools/databases/dataConnections. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools/databases/dataConnections. + * + * @param type the type value to set. + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model DataConnectionCheckNameRequest")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionKind.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionKind.java new file mode 100644 index 0000000000000..1a8055d35d302 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataConnectionKind. */ +public final class DataConnectionKind extends ExpandableStringEnum { + /** Static value EventHub for DataConnectionKind. */ + public static final DataConnectionKind EVENT_HUB = fromString("EventHub"); + + /** Static value EventGrid for DataConnectionKind. */ + public static final DataConnectionKind EVENT_GRID = fromString("EventGrid"); + + /** Static value IotHub for DataConnectionKind. */ + public static final DataConnectionKind IOT_HUB = fromString("IotHub"); + + /** + * Creates or finds a DataConnectionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectionKind. + */ + @JsonCreator + public static DataConnectionKind fromString(String name) { + return fromString(name, DataConnectionKind.class); + } + + /** @return known DataConnectionKind values. */ + public static Collection values() { + return values(DataConnectionKind.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionListResult.java new file mode 100644 index 0000000000000..67dc0d4a4dcbc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto data connections operation response. */ +@Fluent +public final class DataConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionListResult.class); + + /* + * The list of Kusto data connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto data connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto data connections. + * + * @param value the value value to set. + * @return the DataConnectionListResult object itself. + */ + public DataConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidation.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidation.java new file mode 100644 index 0000000000000..d34cec9162586 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; + +/** An immutable client-side representation of DataConnectionValidation. */ +public interface DataConnectionValidation { + /** + * Gets the dataConnectionName property: The name of the data connection. + * + * @return the dataConnectionName value. + */ + String dataConnectionName(); + + /** + * Gets the properties property: The data connection properties to validate. + * + * @return the properties value. + */ + DataConnection properties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner object. + * + * @return the inner object. + */ + DataConnectionValidationInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationListResult.java new file mode 100644 index 0000000000000..b62ec5bec285e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner; +import java.util.List; + +/** An immutable client-side representation of DataConnectionValidationListResult. */ +public interface DataConnectionValidationListResult { + /** + * Gets the value property: The list of Kusto data connection validation errors. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationListResultInner object. + * + * @return the inner object. + */ + DataConnectionValidationListResultInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationResult.java new file mode 100644 index 0000000000000..4485f08a6e8cb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnectionValidationResult.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result returned from a data connection validation request. */ +@Fluent +public final class DataConnectionValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataConnectionValidationResult.class); + + /* + * A message which indicates a problem in data connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get the errorMessage property: A message which indicates a problem in data connection validation. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: A message which indicates a problem in data connection validation. + * + * @param errorMessage the errorMessage value to set. + * @return the DataConnectionValidationResult object itself. + */ + public DataConnectionValidationResult withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnections.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnections.java new file mode 100644 index 0000000000000..45c46273254b1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataConnections.java @@ -0,0 +1,303 @@ +// 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.DataConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionValidationInner; + +/** Resource collection API of DataConnections. */ +public interface DataConnections { + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this 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 resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionCheckNameRequest dataConnectionName, + Context context); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection 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 the list Kusto data connection validation result. + */ + DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection validation result. + */ + DataConnectionValidationListResult dataConnectionValidation( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DataConnectionValidationInner parameters, + Context context); + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Returns the list of data connections of the given Kusto pool database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 list Kusto data connections operation response. + */ + PagedIterable listByDatabase( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 data connection. + */ + DataConnection get( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName); + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this 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 data connection. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + DataConnection createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 data connection. + */ + DataConnection createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection 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 data connection. + */ + DataConnection update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters); + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @param context The context to associate with this 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 data connection. + */ + DataConnection update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + DataConnectionInner parameters, + Context context); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param dataConnectionName The name of the data connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + String dataConnectionName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Database.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Database.java new file mode 100644 index 0000000000000..44aae1458b906 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Database.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; + +/** An immutable client-side representation of Database. */ +public interface Database { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DatabaseInner object. + * + * @return the inner object. + */ + DatabaseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseCheckNameRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseCheckNameRequest.java new file mode 100644 index 0000000000000..68b1c8b0d788f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseCheckNameRequest.java @@ -0,0 +1,87 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result returned from a database check name availability request. */ +@Fluent +public final class DatabaseCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseCheckNameRequest.class); + + /* + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, for instance + * Microsoft.Synapse/workspaces/kustoPools/databases. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name. + * + * @param name the name value to set. + * @return the DatabaseCheckNameRequest object itself. + */ + public DatabaseCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, for instance Microsoft.Synapse/workspaces/kustoPools/databases. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of resource, for instance Microsoft.Synapse/workspaces/kustoPools/databases. + * + * @param type the type value to set. + * @return the DatabaseCheckNameRequest object itself. + */ + public DatabaseCheckNameRequest withType(Type type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model DatabaseCheckNameRequest")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model DatabaseCheckNameRequest")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseListResult.java new file mode 100644 index 0000000000000..99b508e14baa7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto databases operation response. */ +@Fluent +public final class DatabaseListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseListResult.class); + + /* + * The list of Kusto databases. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto databases. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto databases. + * + * @param value the value value to set. + * @return the DatabaseListResult object itself. + */ + public DatabaseListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignment.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignment.java new file mode 100644 index 0000000000000..abcf40d14b940 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignment.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; + +/** An immutable client-side representation of DatabasePrincipalAssignment. */ +public interface DatabasePrincipalAssignment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the principalId property: The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the role property: Database principal role. + * + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * Gets the tenantId property: The tenant id of the principal. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the principalType property: Principal type. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the tenantName property: The tenant name of the principal. + * + * @return the tenantName value. + */ + String tenantName(); + + /** + * Gets the principalName property: The principal name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner object. + * + * @return the inner object. + */ + DatabasePrincipalAssignmentInner innerModel(); + + /** The entirety of the DatabasePrincipalAssignment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DatabasePrincipalAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the DatabasePrincipalAssignment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies workspaceName, kustoPoolName, databaseName, resourceGroupName. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingDatabase( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName); + } + /** + * The stage of the DatabasePrincipalAssignment definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrincipalId, + DefinitionStages.WithRole, + DefinitionStages.WithTenantId, + DefinitionStages.WithPrincipalType { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabasePrincipalAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabasePrincipalAssignment create(Context context); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Database principal role.. + * + * @param role Database principal role. + * @return the next definition stage. + */ + WithCreate withRole(DatabasePrincipalRole role); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + /** The stage of the DatabasePrincipalAssignment definition allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + } + /** + * Begins update for the DatabasePrincipalAssignment resource. + * + * @return the stage of resource update. + */ + DatabasePrincipalAssignment.Update update(); + + /** The template for DatabasePrincipalAssignment update. */ + interface Update + extends UpdateStages.WithPrincipalId, + UpdateStages.WithRole, + UpdateStages.WithTenantId, + UpdateStages.WithPrincipalType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabasePrincipalAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabasePrincipalAssignment apply(Context context); + } + /** The DatabasePrincipalAssignment update stages. */ + interface UpdateStages { + /** The stage of the DatabasePrincipalAssignment update allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name.. + * + * @param principalId The principal ID assigned to the database principal. It can be a user email, + * application ID, or security group name. + * @return the next definition stage. + */ + Update withPrincipalId(String principalId); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify role. */ + interface WithRole { + /** + * Specifies the role property: Database principal role.. + * + * @param role Database principal role. + * @return the next definition stage. + */ + Update withRole(DatabasePrincipalRole role); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify tenantId. */ + interface WithTenantId { + /** + * Specifies the tenantId property: The tenant id of the principal. + * + * @param tenantId The tenant id of the principal. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + /** The stage of the DatabasePrincipalAssignment update allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: Principal type.. + * + * @param principalType Principal type. + * @return the next definition stage. + */ + Update withPrincipalType(PrincipalType principalType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabasePrincipalAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabasePrincipalAssignment refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentCheckNameRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentCheckNameRequest.java new file mode 100644 index 0000000000000..24f4bc9720e7d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentCheckNameRequest.java @@ -0,0 +1,90 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A principal assignment check name availability request. */ +@Fluent +public final class DatabasePrincipalAssignmentCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentCheckNameRequest.class); + + /* + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, + * Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of DatabasePrincipalAssignmentCheckNameRequest class. */ + public DatabasePrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments"; + } + + /** + * Get the name property: Principal Assignment resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Principal Assignment resource name. + * + * @param name the name value to set. + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, + * Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, + * Microsoft.Synapse/workspaces/kustoPools/databases/principalAssignments. + * + * @param type the type value to set. + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model DatabasePrincipalAssignmentCheckNameRequest")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentListResult.java new file mode 100644 index 0000000000000..d0c8262f209c1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignmentListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DatabasePrincipalAssignmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto database principal assignments operation response. */ +@Fluent +public final class DatabasePrincipalAssignmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabasePrincipalAssignmentListResult.class); + + /* + * The list of Kusto database principal assignments. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Kusto database principal assignments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Kusto database principal assignments. + * + * @param value the value value to set. + * @return the DatabasePrincipalAssignmentListResult object itself. + */ + public DatabasePrincipalAssignmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignments.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignments.java new file mode 100644 index 0000000000000..369baf761ad9b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalAssignments.java @@ -0,0 +1,219 @@ +// 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; + +/** Resource collection API of DatabasePrincipalAssignments. */ +public interface DatabasePrincipalAssignments { + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param principalAssignmentName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String resourceGroupName, + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName); + + /** + * Lists all Kusto pool database principalAssignments. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 principal assignments operation response. + */ + PagedIterable list( + String workspaceName, String kustoPoolName, String databaseName, String resourceGroupName, Context context); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + DatabasePrincipalAssignment get( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 database principalAssignment. + */ + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String databaseName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @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 database principalAssignment. + */ + DatabasePrincipalAssignment getById(String id); + + /** + * Gets a Kusto pool database principalAssignment. + * + * @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 database principalAssignment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @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 principalAssignment. + * + * @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 DatabasePrincipalAssignment resource. + * + * @param name resource name. + * @return the first stage of the new DatabasePrincipalAssignment definition. + */ + DatabasePrincipalAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalRole.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalRole.java new file mode 100644 index 0000000000000..21d719fa2f254 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabasePrincipalRole.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabasePrincipalRole. */ +public final class DatabasePrincipalRole extends ExpandableStringEnum { + /** Static value Admin for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole ADMIN = fromString("Admin"); + + /** Static value Ingestor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole INGESTOR = fromString("Ingestor"); + + /** Static value Monitor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole MONITOR = fromString("Monitor"); + + /** Static value User for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole USER = fromString("User"); + + /** Static value UnrestrictedViewer for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole UNRESTRICTED_VIEWER = fromString("UnrestrictedViewer"); + + /** Static value Viewer for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole VIEWER = fromString("Viewer"); + + /** + * Creates or finds a DatabasePrincipalRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabasePrincipalRole. + */ + @JsonCreator + public static DatabasePrincipalRole fromString(String name) { + return fromString(name, DatabasePrincipalRole.class); + } + + /** @return known DatabasePrincipalRole values. */ + public static Collection values() { + return values(DatabasePrincipalRole.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseStatistics.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseStatistics.java new file mode 100644 index 0000000000000..1b3ac4201537f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DatabaseStatistics.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A class that contains database statistics information. */ +@Fluent +public final class DatabaseStatistics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseStatistics.class); + + /* + * The database size - the total size of compressed data and index in + * bytes. + */ + @JsonProperty(value = "size") + private Float size; + + /** + * Get the size property: The database size - the total size of compressed data and index in bytes. + * + * @return the size value. + */ + public Float size() { + return this.size; + } + + /** + * Set the size property: The database size - the total size of compressed data and index in bytes. + * + * @param size the size value to set. + * @return the DatabaseStatistics object itself. + */ + public DatabaseStatistics withSize(Float size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Databases.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Databases.java new file mode 100644 index 0000000000000..fed60c279eb83 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Databases.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.DatabaseInner; + +/** Resource collection API of Databases. */ +public interface Databases { + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + PagedIterable listByKustoPool(String resourceGroupName, String workspaceName, String kustoPoolName); + + /** + * Returns the list of databases of the given Kusto pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 list Kusto databases operation response. + */ + PagedIterable listByKustoPool( + String resourceGroupName, String workspaceName, String kustoPoolName, Context context); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + Database get(String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 class representing a Kusto database. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + Database createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @param context The context to associate with this 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 database. + */ + Database createOrUpdate( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database 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 database. + */ + Database update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters); + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in the Kusto pool. + * @param parameters The database parameters supplied to the Update operation. + * @param context The context to associate with this 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 database. + */ + Database update( + String resourceGroupName, + String workspaceName, + String kustoPoolName, + String databaseName, + DatabaseInner parameters, + Context context); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param databaseName The name of the database in 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 resourceGroupName, String workspaceName, String kustoPoolName, String databaseName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DefaultPrincipalsModificationKind.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DefaultPrincipalsModificationKind.java new file mode 100644 index 0000000000000..734d96e7b3f66 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DefaultPrincipalsModificationKind.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultPrincipalsModificationKind. */ +public final class DefaultPrincipalsModificationKind extends ExpandableStringEnum { + /** Static value Union for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind UNION = fromString("Union"); + + /** Static value Replace for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind REPLACE = fromString("Replace"); + + /** Static value None for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind NONE = fromString("None"); + + /** + * Creates or finds a DefaultPrincipalsModificationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultPrincipalsModificationKind. + */ + @JsonCreator + public static DefaultPrincipalsModificationKind fromString(String name) { + return fromString(name, DefaultPrincipalsModificationKind.class); + } + + /** @return known DefaultPrincipalsModificationKind values. */ + public static Collection values() { + return values(DefaultPrincipalsModificationKind.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataConnection.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataConnection.java new file mode 100644 index 0000000000000..3131ef7482acb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataConnection.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Class representing an Event Grid data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventGrid") +@JsonFlatten +@Fluent +public class EventGridDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventGridDataConnection.class); + + /* + * The resource ID of the storage account where the data resides. + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /* + * The resource ID where the event grid is configured to send events. + */ + @JsonProperty(value = "properties.eventHubResourceId") + private String eventHubResourceId; + + /* + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private EventGridDataFormat dataFormat; + + /* + * A Boolean value that, if set to true, indicates that ingestion should + * ignore the first record of every file + */ + @JsonProperty(value = "properties.ignoreFirstRecord") + private Boolean ignoreFirstRecord; + + /* + * The name of blob storage event type to process. + */ + @JsonProperty(value = "properties.blobStorageEventType") + private BlobStorageEventType blobStorageEventType; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /** + * Get the storageAccountResourceId property: The resource ID of the storage account where the data resides. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: The resource ID of the storage account where the data resides. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the eventHubResourceId property: The resource ID where the event grid is configured to send events. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID where the event grid is configured to send events. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The event hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public EventGridDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withDataFormat(EventGridDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the ignoreFirstRecord property: A Boolean value that, if set to true, indicates that ingestion should ignore + * the first record of every file. + * + * @return the ignoreFirstRecord value. + */ + public Boolean ignoreFirstRecord() { + return this.ignoreFirstRecord; + } + + /** + * Set the ignoreFirstRecord property: A Boolean value that, if set to true, indicates that ingestion should ignore + * the first record of every file. + * + * @param ignoreFirstRecord the ignoreFirstRecord value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withIgnoreFirstRecord(Boolean ignoreFirstRecord) { + this.ignoreFirstRecord = ignoreFirstRecord; + return this; + } + + /** + * Get the blobStorageEventType property: The name of blob storage event type to process. + * + * @return the blobStorageEventType value. + */ + public BlobStorageEventType blobStorageEventType() { + return this.blobStorageEventType; + } + + /** + * Set the blobStorageEventType property: The name of blob storage event type to process. + * + * @param blobStorageEventType the blobStorageEventType value to set. + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withBlobStorageEventType(BlobStorageEventType blobStorageEventType) { + this.blobStorageEventType = blobStorageEventType; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public EventGridDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataFormat.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataFormat.java new file mode 100644 index 0000000000000..8a27b48f7810b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventGridDataFormat.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventGridDataFormat. */ +public final class EventGridDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventGridDataFormat. */ + public static final EventGridDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventGridDataFormat. */ + public static final EventGridDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventGridDataFormat. */ + public static final EventGridDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventGridDataFormat. */ + public static final EventGridDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventGridDataFormat. */ + public static final EventGridDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventGridDataFormat. */ + public static final EventGridDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventGridDataFormat. */ + public static final EventGridDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventGridDataFormat. */ + public static final EventGridDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventGridDataFormat. */ + public static final EventGridDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventGridDataFormat. */ + public static final EventGridDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventGridDataFormat. */ + public static final EventGridDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventGridDataFormat. */ + public static final EventGridDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventGridDataFormat. */ + public static final EventGridDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventGridDataFormat. */ + public static final EventGridDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventGridDataFormat. */ + public static final EventGridDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventGridDataFormat. */ + public static final EventGridDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventGridDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventGridDataFormat. + */ + @JsonCreator + public static EventGridDataFormat fromString(String name) { + return fromString(name, EventGridDataFormat.class); + } + + /** @return known EventGridDataFormat values. */ + public static Collection values() { + return values(EventGridDataFormat.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 new file mode 100644 index 0000000000000..286ef2908bb0f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataConnection.java @@ -0,0 +1,247 @@ +// 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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Class representing an event hub data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("EventHub") +@JsonFlatten +@Fluent +public class EventHubDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventHubDataConnection.class); + + /* + * The resource ID of the event hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.eventHubResourceId") + private String eventHubResourceId; + + /* + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private EventHubDataFormat dataFormat; + + /* + * System properties of the event hub + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /* + * The event hub messages compression type + */ + @JsonProperty(value = "properties.compression") + private Compression compression; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /** + * Get the eventHubResourceId property: The resource ID of the event hub to be used to create a data connection. + * + * @return the eventHubResourceId value. + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the eventHubResourceId property: The resource ID of the event hub to be used to create a data connection. + * + * @param eventHubResourceId the eventHubResourceId value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The event hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public EventHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withDataFormat(EventHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the eventSystemProperties property: System properties of the event hub. + * + * @return the eventSystemProperties value. + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set the eventSystemProperties property: System properties of the event hub. + * + * @param eventSystemProperties the eventSystemProperties value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the compression property: The event hub messages compression type. + * + * @return the compression value. + */ + public Compression compression() { + return this.compression; + } + + /** + * Set the compression property: The event hub messages compression type. + * + * @param compression the compression value to set. + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withCompression(Compression compression) { + this.compression = compression; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public EventHubDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataFormat.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataFormat.java new file mode 100644 index 0000000000000..9e6e5b104de5b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EventHubDataFormat.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventHubDataFormat. */ +public final class EventHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventHubDataFormat. */ + public static final EventHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventHubDataFormat. */ + public static final EventHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventHubDataFormat. */ + public static final EventHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventHubDataFormat. */ + public static final EventHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventHubDataFormat. */ + public static final EventHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventHubDataFormat. */ + public static final EventHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventHubDataFormat. */ + public static final EventHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventHubDataFormat. */ + public static final EventHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventHubDataFormat. */ + public static final EventHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventHubDataFormat. */ + public static final EventHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventHubDataFormat. */ + public static final EventHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventHubDataFormat. */ + public static final EventHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventHubDataFormat. */ + public static final EventHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventHubDataFormat. */ + public static final EventHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventHubDataFormat. */ + public static final EventHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventHubDataFormat. */ + public static final EventHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventHubDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventHubDataFormat. + */ + @JsonCreator + public static EventHubDataFormat fromString(String name) { + return fromString(name, EventHubDataFormat.class); + } + + /** @return known EventHubDataFormat values. */ + public static Collection values() { + return values(EventHubDataFormat.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseDefinition.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseDefinition.java new file mode 100644 index 0000000000000..ce89c0ae26afc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseDefinition.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.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; + +/** An immutable client-side representation of FollowerDatabaseDefinition. */ +public interface FollowerDatabaseDefinition { + /** + * Gets the clusterResourceId property: Resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * Gets the attachedDatabaseConfigurationName property: Resource name of the attached database configuration in the + * follower cluster. + * + * @return the attachedDatabaseConfigurationName value. + */ + String attachedDatabaseConfigurationName(); + + /** + * Gets the databaseName property: The database name owned by this cluster that was followed. * in case following + * all databases. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner object. + * + * @return the inner object. + */ + FollowerDatabaseDefinitionInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseListResult.java new file mode 100644 index 0000000000000..927b91f78c4fe --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/FollowerDatabaseListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list Kusto database principals operation response. */ +@Fluent +public final class FollowerDatabaseListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FollowerDatabaseListResult.class); + + /* + * The list of follower database result. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of follower database result. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of follower database result. + * + * @param value the value value to set. + * @return the FollowerDatabaseListResult object itself. + */ + public FollowerDatabaseListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataConnection.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataConnection.java new file mode 100644 index 0000000000000..476a3cc4d3d7f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataConnection.java @@ -0,0 +1,247 @@ +// 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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Class representing an iot hub data connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("IotHub") +@JsonFlatten +@Fluent +public class IotHubDataConnection extends DataConnectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotHubDataConnection.class); + + /* + * The resource ID of the Iot hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.iotHubResourceId") + private String iotHubResourceId; + + /* + * The iot hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup") + private String consumerGroup; + + /* + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /* + * The data format of the message. Optionally the data format can be added + * to each message. + */ + @JsonProperty(value = "properties.dataFormat") + private IotHubDataFormat dataFormat; + + /* + * System properties of the iot hub + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /* + * The name of the share access policy + */ + @JsonProperty(value = "properties.sharedAccessPolicyName") + private String sharedAccessPolicyName; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /** + * Get the iotHubResourceId property: The resource ID of the Iot hub to be used to create a data connection. + * + * @return the iotHubResourceId value. + */ + public String iotHubResourceId() { + return this.iotHubResourceId; + } + + /** + * Set the iotHubResourceId property: The resource ID of the Iot hub to be used to create a data connection. + * + * @param iotHubResourceId the iotHubResourceId value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withIotHubResourceId(String iotHubResourceId) { + this.iotHubResourceId = iotHubResourceId; + return this; + } + + /** + * Get the consumerGroup property: The iot hub consumer group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: The iot hub consumer group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The table where the data should be ingested. Optionally the table information can be + * added to each message. + * + * @param tableName the tableName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @return the mappingRuleName value. + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mappingRuleName property: The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @return the dataFormat value. + */ + public IotHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: The data format of the message. Optionally the data format can be added to each + * message. + * + * @param dataFormat the dataFormat value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withDataFormat(IotHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the eventSystemProperties property: System properties of the iot hub. + * + * @return the eventSystemProperties value. + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set the eventSystemProperties property: System properties of the iot hub. + * + * @param eventSystemProperties the eventSystemProperties value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the sharedAccessPolicyName property: The name of the share access policy. + * + * @return the sharedAccessPolicyName value. + */ + public String sharedAccessPolicyName() { + return this.sharedAccessPolicyName; + } + + /** + * Set the sharedAccessPolicyName property: The name of the share access policy. + * + * @param sharedAccessPolicyName the sharedAccessPolicyName value to set. + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withSharedAccessPolicyName(String sharedAccessPolicyName) { + this.sharedAccessPolicyName = sharedAccessPolicyName; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public IotHubDataConnection withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataFormat.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataFormat.java new file mode 100644 index 0000000000000..a3745931996e8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IotHubDataFormat.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IotHubDataFormat. */ +public final class IotHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for IotHubDataFormat. */ + public static final IotHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for IotHubDataFormat. */ + public static final IotHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for IotHubDataFormat. */ + public static final IotHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for IotHubDataFormat. */ + public static final IotHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for IotHubDataFormat. */ + public static final IotHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for IotHubDataFormat. */ + public static final IotHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for IotHubDataFormat. */ + public static final IotHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for IotHubDataFormat. */ + public static final IotHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for IotHubDataFormat. */ + public static final IotHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for IotHubDataFormat. */ + public static final IotHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for IotHubDataFormat. */ + public static final IotHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for IotHubDataFormat. */ + public static final IotHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for IotHubDataFormat. */ + public static final IotHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for IotHubDataFormat. */ + public static final IotHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for IotHubDataFormat. */ + public static final IotHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for IotHubDataFormat. */ + public static final IotHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a IotHubDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding IotHubDataFormat. + */ + @JsonCreator + public static IotHubDataFormat fromString(String name) { + return fromString(name, IotHubDataFormat.class); + } + + /** @return known IotHubDataFormat values. */ + public static Collection values() { + return values(IotHubDataFormat.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KekIdentityProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KekIdentityProperties.java new file mode 100644 index 0000000000000..c09adc10219ec --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KekIdentityProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key encryption key properties. */ +@Fluent +public final class KekIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KekIdentityProperties.class); + + /* + * User assigned identity resource Id + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /* + * Boolean specifying whether to use system assigned identity or not + */ + @JsonProperty(value = "useSystemAssignedIdentity") + private Object useSystemAssignedIdentity; + + /** + * Get the userAssignedIdentity property: User assigned identity resource Id. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: User assigned identity resource Id. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the KekIdentityProperties object itself. + */ + public KekIdentityProperties withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Get the useSystemAssignedIdentity property: Boolean specifying whether to use system assigned identity or not. + * + * @return the useSystemAssignedIdentity value. + */ + public Object useSystemAssignedIdentity() { + return this.useSystemAssignedIdentity; + } + + /** + * Set the useSystemAssignedIdentity property: Boolean specifying whether to use system assigned identity or not. + * + * @param useSystemAssignedIdentity the useSystemAssignedIdentity value to set. + * @return the KekIdentityProperties object itself. + */ + public KekIdentityProperties withUseSystemAssignedIdentity(Object useSystemAssignedIdentity) { + this.useSystemAssignedIdentity = useSystemAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Kind.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Kind.java new file mode 100644 index 0000000000000..5215ca1318b7f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Kind.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value ReadWrite for Kind. */ + public static final Kind READ_WRITE = fromString("ReadWrite"); + + /** Static value ReadOnlyFollowing for Kind. */ + public static final Kind READ_ONLY_FOLLOWING = fromString("ReadOnlyFollowing"); + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** @return known Kind values. */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoOperations.java new file mode 100644 index 0000000000000..ca3070418e2eb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoOperations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of KustoOperations. */ +public interface KustoOperations { + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + PagedIterable list(); + + /** + * Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. + * + * @param context The context to associate with this 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 result of the request to list REST API operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPool.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPool.java new file mode 100644 index 0000000000000..74bf972dd0e82 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPool.java @@ -0,0 +1,581 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner; +import java.util.Map; + +/** An immutable client-side representation of KustoPool. */ +public interface KustoPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU of the kusto pool. + * + * @return the sku value. + */ + AzureSku sku(); + + /** + * Gets the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the state property: The state of the resource. + * + * @return the state value. + */ + State state(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the uri property: The Kusto Pool URI. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the dataIngestionUri property: The Kusto Pool data ingestion URI. + * + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * Gets the stateReason property: The reason for the Kusto Pool's current state. + * + * @return the stateReason value. + */ + String stateReason(); + + /** + * Gets the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + OptimizedAutoscale optimizedAutoscale(); + + /** + * Gets the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + Boolean enableStreamingIngest(); + + /** + * Gets the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + Boolean enablePurge(); + + /** + * Gets the languageExtensions property: List of the Kusto Pool's language extensions. + * + * @return the languageExtensions value. + */ + LanguageExtensionsList languageExtensions(); + + /** + * Gets the workspaceUid property: The workspace unique identifier. + * + * @return the workspaceUid value. + */ + String workspaceUid(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner object. + * + * @return the inner object. + */ + KustoPoolInner innerModel(); + + /** The entirety of the KustoPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The KustoPool definition stages. */ + interface DefinitionStages { + /** The first stage of the KustoPool definition. */ + interface Blank extends WithLocation { + } + /** The stage of the KustoPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the KustoPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies workspaceName, resourceGroupName. + * + * @param workspaceName The name of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithSku withExistingWorkspace(String workspaceName, String resourceGroupName); + } + /** The stage of the KustoPool definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the kusto pool.. + * + * @param sku The SKU of the kusto pool. + * @return the next definition stage. + */ + WithCreate withSku(AzureSku sku); + } + /** + * The stage of the KustoPool definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithOptimizedAutoscale, + DefinitionStages.WithEnableStreamingIngest, + DefinitionStages.WithEnablePurge, + DefinitionStages.WithWorkspaceUid, + DefinitionStages.WithIfMatch, + DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + KustoPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KustoPool create(Context context); + } + /** The stage of the KustoPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the KustoPool definition allowing to specify optimizedAutoscale. */ + interface WithOptimizedAutoscale { + /** + * Specifies the optimizedAutoscale property: Optimized auto scale definition.. + * + * @param optimizedAutoscale Optimized auto scale definition. + * @return the next definition stage. + */ + WithCreate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + /** The stage of the KustoPool definition allowing to specify enableStreamingIngest. */ + interface WithEnableStreamingIngest { + /** + * Specifies the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is + * enabled.. + * + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled. + * @return the next definition stage. + */ + WithCreate withEnableStreamingIngest(Boolean enableStreamingIngest); + } + /** The stage of the KustoPool definition allowing to specify enablePurge. */ + interface WithEnablePurge { + /** + * Specifies the enablePurge property: A boolean value that indicates if the purge operations are enabled.. + * + * @param enablePurge A boolean value that indicates if the purge operations are enabled. + * @return the next definition stage. + */ + WithCreate withEnablePurge(Boolean enablePurge); + } + /** The stage of the KustoPool definition allowing to specify workspaceUid. */ + interface WithWorkspaceUid { + /** + * Specifies the workspaceUid property: The workspace unique identifier.. + * + * @param workspaceUid The workspace unique identifier. + * @return the next definition stage. + */ + WithCreate withWorkspaceUid(String workspaceUid); + } + /** The stage of the KustoPool definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: 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 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. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + /** The stage of the KustoPool definition allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: 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 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. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + /** + * Begins update for the KustoPool resource. + * + * @return the stage of resource update. + */ + KustoPool.Update update(); + + /** The template for KustoPool update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithOptimizedAutoscale, + UpdateStages.WithEnableStreamingIngest, + UpdateStages.WithEnablePurge, + UpdateStages.WithWorkspaceUid, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KustoPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KustoPool apply(Context context); + } + /** The KustoPool update stages. */ + interface UpdateStages { + /** The stage of the KustoPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the KustoPool update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the kusto pool.. + * + * @param sku The SKU of the kusto pool. + * @return the next definition stage. + */ + Update withSku(AzureSku sku); + } + /** The stage of the KustoPool update allowing to specify optimizedAutoscale. */ + interface WithOptimizedAutoscale { + /** + * Specifies the optimizedAutoscale property: Optimized auto scale definition.. + * + * @param optimizedAutoscale Optimized auto scale definition. + * @return the next definition stage. + */ + Update withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + /** The stage of the KustoPool update allowing to specify enableStreamingIngest. */ + interface WithEnableStreamingIngest { + /** + * Specifies the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is + * enabled.. + * + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled. + * @return the next definition stage. + */ + Update withEnableStreamingIngest(Boolean enableStreamingIngest); + } + /** The stage of the KustoPool update allowing to specify enablePurge. */ + interface WithEnablePurge { + /** + * Specifies the enablePurge property: A boolean value that indicates if the purge operations are enabled.. + * + * @param enablePurge A boolean value that indicates if the purge operations are enabled. + * @return the next definition stage. + */ + Update withEnablePurge(Boolean enablePurge); + } + /** The stage of the KustoPool update allowing to specify workspaceUid. */ + interface WithWorkspaceUid { + /** + * Specifies the workspaceUid property: The workspace unique identifier.. + * + * @param workspaceUid The workspace unique identifier. + * @return the next definition stage. + */ + Update withWorkspaceUid(String workspaceUid); + } + /** The stage of the KustoPool update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: 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 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. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KustoPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KustoPool refresh(Context context); + + /** + * Stops a Kusto pool. + * + * @throws com.azure.core.management.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(); + + /** + * Stops a 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 stop(Context context); + + /** + * Starts a Kusto pool. + * + * @throws com.azure.core.management.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(); + + /** + * Starts a 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 start(Context context); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @throws com.azure.core.management.exception.ManagementException 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(); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param context The context to associate with this 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(Context context); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @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(LanguageExtensionsList languageExtensionsToAdd); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @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(LanguageExtensionsList languageExtensionsToAdd, Context context); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @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(LanguageExtensionsList languageExtensionsToRemove); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @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(LanguageExtensionsList languageExtensionsToRemove, Context context); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another Kusto Pool. + * + * @throws com.azure.core.management.exception.ManagementException 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(); + + /** + * Returns a list of databases that are owned by this Kusto Pool and were followed by another 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 list Kusto database principals operation response. + */ + PagedIterable listFollowerDatabases(Context context); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @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(FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Detaches all followers of a database owned by this Kusto Pool. + * + * @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(FollowerDatabaseDefinitionInner followerDatabaseToRemove, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolCheckNameRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolCheckNameRequest.java new file mode 100644 index 0000000000000..03c4fb67358b0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolCheckNameRequest.java @@ -0,0 +1,86 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object sent for a kusto pool check name availability request. */ +@Fluent +public final class KustoPoolCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolCheckNameRequest.class); + + /* + * Kusto Pool name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.Synapse/workspaces/kustoPools. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of KustoPoolCheckNameRequest class. */ + public KustoPoolCheckNameRequest() { + type = "Microsoft.Synapse/workspaces/kustoPools"; + } + + /** + * Get the name property: Kusto Pool name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Kusto Pool name. + * + * @param name the name value to set. + * @return the KustoPoolCheckNameRequest object itself. + */ + public KustoPoolCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Synapse/workspaces/kustoPools. + * + * @param type the type value to set. + * @return the KustoPoolCheckNameRequest object itself. + */ + public KustoPoolCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model KustoPoolCheckNameRequest")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolChildResources.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolChildResources.java new file mode 100644 index 0000000000000..8e2d60f978761 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolChildResources.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of KustoPoolChildResources. */ +public interface KustoPoolChildResources { + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String workspaceName, String kustoPoolName, String resourceGroupName, DatabaseCheckNameRequest resourceName); + + /** + * Checks that the Kusto Pool child resource name is valid and is not already in use. + * + * @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 resourceName The name of the Kusto Pool child resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String workspaceName, + String kustoPoolName, + String resourceGroupName, + DatabaseCheckNameRequest resourceName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolListResult.java new file mode 100644 index 0000000000000..f89a6afe93e60 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner; +import java.util.List; + +/** An immutable client-side representation of KustoPoolListResult. */ +public interface KustoPoolListResult { + /** + * Gets the value property: The list of Kusto pools. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.KustoPoolListResultInner object. + * + * @return the inner object. + */ + KustoPoolListResultInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolPrincipalAssignments.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolPrincipalAssignments.java new file mode 100644 index 0000000000000..13e3f77fe3e8e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolPrincipalAssignments.java @@ -0,0 +1,198 @@ +// 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; + +/** Resource collection API of KustoPoolPrincipalAssignments. */ +public interface KustoPoolPrincipalAssignments { + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName); + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @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 principalAssignmentName The name of the principal assignment. + * @param context The context to associate with this 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 workspaceName, + String kustoPoolName, + String resourceGroupName, + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, + Context context); + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName); + + /** + * Lists all Kusto pool principalAssignments. + * + * @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 cluster principal assignments operation response. + */ + PagedIterable list( + String workspaceName, String kustoPoolName, String resourceGroupName, Context context); + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + ClusterPrincipalAssignment get( + String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName); + + /** + * Gets a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 principalAssignment. + */ + Response getWithResponse( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete(String workspaceName, String kustoPoolName, String principalAssignmentName, String resourceGroupName); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @param workspaceName The name of the workspace. + * @param kustoPoolName The name of the Kusto pool. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @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 delete( + String workspaceName, + String kustoPoolName, + String principalAssignmentName, + String resourceGroupName, + Context context); + + /** + * Gets a Kusto pool principalAssignment. + * + * @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 principalAssignment. + */ + ClusterPrincipalAssignment getById(String id); + + /** + * Gets a Kusto pool principalAssignment. + * + * @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 principalAssignment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Kusto pool principalAssignment. + * + * @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 principalAssignment. + * + * @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 ClusterPrincipalAssignment resource. + * + * @param name resource name. + * @return the first stage of the new ClusterPrincipalAssignment definition. + */ + ClusterPrincipalAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolUpdate.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolUpdate.java new file mode 100644 index 0000000000000..1d63e42c0127c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolUpdate.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Class representing an update to a Kusto kusto pool. */ +@JsonFlatten +@Fluent +public class KustoPoolUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KustoPoolUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The SKU of the kusto pool. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /* + * The state of the resource. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /* + * The Kusto Pool URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * The Kusto Pool data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /* + * The reason for the Kusto Pool's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /* + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /* + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /* + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /* + * List of the Kusto Pool's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /* + * The workspace unique identifier. + */ + @JsonProperty(value = "properties.workspaceUID") + private String workspaceUid; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The SKU of the kusto pool. + * + * @return the sku value. + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the kusto pool. + * + * @param sku the sku value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the state property: The state of the resource. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the uri property: The Kusto Pool URI. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the dataIngestionUri property: The Kusto Pool data ingestion URI. + * + * @return the dataIngestionUri value. + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the stateReason property: The reason for the Kusto Pool's current state. + * + * @return the stateReason value. + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the optimizedAutoscale property: Optimized auto scale definition. + * + * @return the optimizedAutoscale value. + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set the optimizedAutoscale property: Optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value. + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set the enableStreamingIngest property: A boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value. + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set the enablePurge property: A boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get the languageExtensions property: List of the Kusto Pool's language extensions. + * + * @return the languageExtensions value. + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get the workspaceUid property: The workspace unique identifier. + * + * @return the workspaceUid value. + */ + public String workspaceUid() { + return this.workspaceUid; + } + + /** + * Set the workspaceUid property: The workspace unique identifier. + * + * @param workspaceUid the workspaceUid value to set. + * @return the KustoPoolUpdate object itself. + */ + public KustoPoolUpdate withWorkspaceUid(String workspaceUid) { + this.workspaceUid = workspaceUid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (optimizedAutoscale() != null) { + optimizedAutoscale().validate(); + } + if (languageExtensions() != null) { + languageExtensions().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..8824d53d311e7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPools.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of KustoPools. */ +public interface KustoPools { + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @throws com.azure.core.management.exception.ManagementException 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 the SKU descriptions. + */ + PagedIterable list(); + + /** + * Lists eligible SKUs for Kusto Pool resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the SKU descriptions. + */ + PagedIterable list(Context context); +} 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 new file mode 100644 index 0000000000000..c261f69327985 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KustoPoolsOperations.java @@ -0,0 +1,415 @@ +// 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/LanguageExtension.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtension.java new file mode 100644 index 0000000000000..65eb4170a7242 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtension.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; + +/** An immutable client-side representation of LanguageExtension. */ +public interface LanguageExtension { + /** + * Gets the languageExtensionName property: The language extension name. + * + * @return the languageExtensionName value. + */ + LanguageExtensionName languageExtensionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner object. + * + * @return the inner object. + */ + LanguageExtensionInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionName.java new file mode 100644 index 0000000000000..ad0fb94280cf9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LanguageExtensionName. */ +public final class LanguageExtensionName extends ExpandableStringEnum { + /** Static value PYTHON for LanguageExtensionName. */ + public static final LanguageExtensionName PYTHON = fromString("PYTHON"); + + /** Static value R for LanguageExtensionName. */ + public static final LanguageExtensionName R = fromString("R"); + + /** + * Creates or finds a LanguageExtensionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LanguageExtensionName. + */ + @JsonCreator + public static LanguageExtensionName fromString(String name) { + return fromString(name, LanguageExtensionName.class); + } + + /** @return known LanguageExtensionName values. */ + public static Collection values() { + return values(LanguageExtensionName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionsList.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionsList.java new file mode 100644 index 0000000000000..ffcdc611b9c05 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LanguageExtensionsList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.LanguageExtensionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of language extension objects. */ +@Fluent +public final class LanguageExtensionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LanguageExtensionsList.class); + + /* + * The list of language extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of language extensions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of language extensions. + * + * @param value the value value to set. + * @return the LanguageExtensionsList object itself. + */ + public LanguageExtensionsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListResourceSkusResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListResourceSkusResult.java new file mode 100644 index 0000000000000..d6172a5f1c16c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListResourceSkusResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.AzureResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of available SKUs for a Kusto Pool. */ +@Fluent +public final class ListResourceSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListResourceSkusResult.class); + + /* + * The collection of available SKUs for an existing resource. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection of available SKUs for an existing resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection of available SKUs for an existing resource. + * + * @param value the value value to set. + * @return the ListResourceSkusResult object itself. + */ + public ListResourceSkusResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java index d6d08a3689916..14d94f92474d4 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; import java.util.UUID; /** The workspace managed identity. */ @@ -33,6 +35,13 @@ public class ManagedIdentity { @JsonProperty(value = "type") private ResourceIdentityType type; + /* + * The user assigned managed identities. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + /** * Get the principalId property: The principal ID of the workspace managed identity. * @@ -71,11 +80,41 @@ public ManagedIdentity withType(ResourceIdentityType type) { return this; } + /** + * Get the userAssignedIdentities property: The user assigned managed identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The user assigned managed identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java index 3a99921b144ed..4f2d43c5d50c7 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java @@ -16,6 +16,12 @@ public final class NodeSizeFamily extends ExpandableStringEnum { /** Static value MemoryOptimized for NodeSizeFamily. */ public static final NodeSizeFamily MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + /** Static value HardwareAcceleratedFPGA for NodeSizeFamily. */ + public static final NodeSizeFamily HARDWARE_ACCELERATED_FPGA = fromString("HardwareAcceleratedFPGA"); + + /** Static value HardwareAcceleratedGPU for NodeSizeFamily. */ + public static final NodeSizeFamily HARDWARE_ACCELERATED_GPU = fromString("HardwareAcceleratedGPU"); + /** * Creates or finds a NodeSizeFamily from its string representation. * diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operation.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operation.java new file mode 100644 index 0000000000000..cc374d6979c10 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operation.java @@ -0,0 +1,45 @@ +// 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.resourcemanager.synapse.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The operation name. This is of the format {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Any object. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationDisplay.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationDisplay.java new file mode 100644 index 0000000000000..eec227fe1d39d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that describes the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The operation type. For example: read, write, delete. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The friendly name of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Friendly name of the resource provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Friendly name of the resource provider. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation property: The operation type. For example: read, write, delete. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation type. For example: read, write, delete. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource property: The resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource type on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description property: The friendly name of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The friendly name of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationListResult.java new file mode 100644 index 0000000000000..d08ccd81f46ce --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the + * next set of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * The list of operations supported by the resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of operations supported by the resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OptimizedAutoscale.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OptimizedAutoscale.java new file mode 100644 index 0000000000000..cc331f25e64b9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OptimizedAutoscale.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A class that contains the optimized auto scale definition. */ +@Fluent +public final class OptimizedAutoscale { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OptimizedAutoscale.class); + + /* + * The version of the template defined, for instance 1. + */ + @JsonProperty(value = "version", required = true) + private int version; + + /* + * A boolean value that indicate if the optimized autoscale feature is + * enabled or not. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /* + * Minimum allowed instances count. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Maximum allowed instances count. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * Get the version property: The version of the template defined, for instance 1. + * + * @return the version value. + */ + public int version() { + return this.version; + } + + /** + * Set the version property: The version of the template defined, for instance 1. + * + * @param version the version value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withVersion(int version) { + this.version = version; + return this; + } + + /** + * Get the isEnabled property: A boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @return the isEnabled value. + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: A boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @param isEnabled the isEnabled value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the minimum property: Minimum allowed instances count. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Minimum allowed instances count. + * + * @param minimum the minimum value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Maximum allowed instances count. + * + * @return the maximum value. + */ + public int maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Maximum allowed instances count. + * + * @param maximum the maximum value to set. + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrincipalType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrincipalType.java new file mode 100644 index 0000000000000..aac49db2a5eca --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrincipalType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrincipalType. */ +public final class PrincipalType extends ExpandableStringEnum { + /** Static value App for PrincipalType. */ + public static final PrincipalType APP = fromString("App"); + + /** Static value Group for PrincipalType. */ + public static final PrincipalType GROUP = fromString("Group"); + + /** Static value User for PrincipalType. */ + public static final PrincipalType USER = fromString("User"); + + /** + * Creates or finds a PrincipalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrincipalType. + */ + @JsonCreator + public static PrincipalType fromString(String name) { + return fromString(name, PrincipalType.class); + } + + /** @return known PrincipalType values. */ + public static Collection values() { + return values(PrincipalType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java index af9e58d9a5b8b..82ef6f3ccf9b9 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java @@ -5,6 +5,7 @@ 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; /** Resource collection API of PrivateEndpointConnectionsPrivateLinkHubs. */ @@ -34,4 +35,33 @@ public interface PrivateEndpointConnectionsPrivateLinkHubs { */ PagedIterable list( String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + PrivateEndpointConnectionForPrivateLinkHub get( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName); + + /** + * Get all PrivateEndpointConnection in the PrivateLinkHub by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateEndpointConnectionName Name of the privateEndpointConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnection in the PrivateLinkHub by name. + */ + Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateEndpointConnectionName, Context context); } diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java index da8411b08f9c7..1ff4b7def66d5 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class PrivateLinkHubPatchInfo { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReadWriteDatabase.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReadWriteDatabase.java new file mode 100644 index 0000000000000..089ddd45de849 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReadWriteDatabase.java @@ -0,0 +1,144 @@ +// 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.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DatabaseInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.Duration; + +/** Class representing a read write database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ReadWrite") +@JsonFlatten +@Fluent +public class ReadWriteDatabase extends DatabaseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReadWriteDatabase.class); + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /* + * The time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod") + private Duration softDeletePeriod; + + /* + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Duration hotCachePeriod; + + /* + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseStatistics statistics; + + /* + * Indicates whether the database is followed. + */ + @JsonProperty(value = "properties.isFollowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFollowed; + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the softDeletePeriod property: The time the data should be kept before it stops being accessible to queries + * in TimeSpan. + * + * @return the softDeletePeriod value. + */ + public Duration softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set the softDeletePeriod property: The time the data should be kept before it stops being accessible to queries + * in TimeSpan. + * + * @param softDeletePeriod the softDeletePeriod value to set. + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withSoftDeletePeriod(Duration softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value. + */ + public Duration hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the hotCachePeriod property: The time the data should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set. + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withHotCachePeriod(Duration hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics property: The statistics of the database. + * + * @return the statistics value. + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Get the isFollowed property: Indicates whether the database is followed. + * + * @return the isFollowed value. + */ + public Boolean isFollowed() { + return this.isFollowed; + } + + /** {@inheritDoc} */ + @Override + public ReadWriteDatabase withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (statistics() != null) { + statistics().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Reason.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Reason.java new file mode 100644 index 0000000000000..125c20e9d92e3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Reason.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Reason. */ +public final class Reason extends ExpandableStringEnum { + /** Static value Invalid for Reason. */ + public static final Reason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for Reason. */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** @return known Reason values. */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java index 3355c642cdad3..4ed7bb95d4549 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class ReplaceAllIpFirewallRulesRequest { * IP firewall rule properties */ @JsonProperty(value = "ipFirewallRules") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map ipFirewallRules; /** diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java index 2a45d76f2654b..aeae93e555dee 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java @@ -13,7 +13,10 @@ public enum ResourceIdentityType { NONE("None"), /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value SystemAssigned,UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned,UserAssigned"); /** The actual serialized value for a ResourceIdentityType instance. */ private final String value; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceProvisioningState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceProvisioningState.java new file mode 100644 index 0000000000000..cdebe877972a5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceProvisioningState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProvisioningState. */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** Static value Running for ResourceProvisioningState. */ + public static final ResourceProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ResourceProvisioningState. */ + public static final ResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ResourceProvisioningState. */ + public static final ResourceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ResourceProvisioningState. */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ResourceProvisioningState. */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ResourceProvisioningState. */ + public static final ResourceProvisioningState MOVING = fromString("Moving"); + + /** Static value Canceled for ResourceProvisioningState. */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProvisioningState. + */ + @JsonCreator + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** @return known ResourceProvisioningState values. */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java index ba7d1b4903c4b..c9fbb05598af4 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java @@ -9,6 +9,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -89,6 +90,7 @@ public class SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus * capabilities. */ @JsonProperty(value = "typeProperties.capabilities", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map capabilities; /* diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescription.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescription.java new file mode 100644 index 0000000000000..7c97688537d86 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescription.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import java.util.List; + +/** An immutable client-side representation of SkuDescription. */ +public interface SkuDescription { + /** + * Gets the resourceType property: The resource type. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of the SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the size property: The size of the SKU. + * + * @return the size value. + */ + String size(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: Locations and zones. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner object. + * + * @return the inner object. + */ + SkuDescriptionInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescriptionList.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescriptionList.java new file mode 100644 index 0000000000000..96be0d89434ce --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuDescriptionList.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SkuDescriptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of the SKU descriptions. */ +@Immutable +public final class SkuDescriptionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuDescriptionList.class); + + /* + * SKU descriptions + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: SKU descriptions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuLocationInfoItem.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuLocationInfoItem.java new file mode 100644 index 0000000000000..41b75caf52490 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuLocationInfoItem.java @@ -0,0 +1,82 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The locations and zones info for SKU. */ +@Fluent +public final class SkuLocationInfoItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuLocationInfoItem.class); + + /* + * The available location of the SKU. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The available zone of the SKU. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the location property: The available location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The available location of the SKU. + * + * @param location the location value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The available zone of the SKU. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The available zone of the SKU. + * + * @param zones the zones value to set. + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model SkuLocationInfoItem")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuName.java new file mode 100644 index 0000000000000..76e2f9aa67c90 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Compute optimized for SkuName. */ + public static final SkuName COMPUTE_OPTIMIZED = fromString("Compute optimized"); + + /** Static value Storage optimized for SkuName. */ + public static final SkuName STORAGE_OPTIMIZED = fromString("Storage optimized"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuSize.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuSize.java new file mode 100644 index 0000000000000..61896a9c7cbb6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SkuSize.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 SkuSize. */ +public final class SkuSize extends ExpandableStringEnum { + /** Static value Extra small for SkuSize. */ + public static final SkuSize EXTRA_SMALL = fromString("Extra small"); + + /** Static value Small for SkuSize. */ + public static final SkuSize SMALL = fromString("Small"); + + /** Static value Medium for SkuSize. */ + public static final SkuSize MEDIUM = fromString("Medium"); + + /** Static value Large for SkuSize. */ + public static final SkuSize LARGE = fromString("Large"); + + /** + * Creates or finds a SkuSize from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuSize. + */ + @JsonCreator + public static SkuSize fromString(String name) { + return fromString(name, SkuSize.class); + } + + /** @return known SkuSize values. */ + public static Collection values() { + return values(SkuSize.class); + } +} 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 615819805386e..5b6a5c7ceedb0 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 @@ -49,7 +49,7 @@ public interface SqlPool { Map tags(); /** - * Gets the sku property: SQL pool SKU. + * Gets the sku property: Sku SQL pool SKU. * * @return the sku value. */ @@ -232,9 +232,9 @@ interface WithTags { /** The stage of the SqlPool definition allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: SQL pool SKU. + * Specifies the sku property: Sku SQL pool SKU. * - * @param sku SQL pool SKU. + * @param sku Sku SQL pool SKU. * @return the next definition stage. */ WithCreate withSku(Sku sku); @@ -392,9 +392,9 @@ interface WithTags { /** The stage of the SqlPool update allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: SQL pool SKU. + * Specifies the sku property: Sku SQL pool SKU. * - * @param sku SQL pool SKU. + * @param sku Sku SQL pool SKU. * @return the next definition stage. */ Update withSku(Sku sku); 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 123c0b31a04f3..c1eb1bad4d0e6 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 @@ -8,6 +8,7 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; @@ -22,6 +23,7 @@ public class SqlPoolPatchInfo { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -31,7 +33,7 @@ public class SqlPoolPatchInfo { private String location; /* - * SQL pool SKU + * Sku SQL pool SKU */ @JsonProperty(value = "sku") private Sku sku; @@ -137,7 +139,7 @@ public SqlPoolPatchInfo withLocation(String location) { } /** - * Get the sku property: SQL pool SKU. + * Get the sku property: Sku SQL pool SKU. * * @return the sku value. */ @@ -146,7 +148,7 @@ public Sku sku() { } /** - * Set the sku property: SQL pool SKU. + * Set the sku property: Sku SQL pool SKU. * * @param sku the sku value to set. * @return the SqlPoolPatchInfo object itself. diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java index a324c1c39e820..e765976db5a65 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.synapse.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -13,7 +13,7 @@ /** Ssis folder. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("Folder") -@Immutable +@Fluent public final class SsisFolder extends SsisObjectMetadata { @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisFolder.class); diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/State.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/State.java new file mode 100644 index 0000000000000..64f0d51423b6f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/State.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +public final class State extends ExpandableStringEnum { + /** Static value Creating for State. */ + public static final State CREATING = fromString("Creating"); + + /** Static value Unavailable for State. */ + public static final State UNAVAILABLE = fromString("Unavailable"); + + /** Static value Running for State. */ + public static final State RUNNING = fromString("Running"); + + /** Static value Deleting for State. */ + public static final State DELETING = fromString("Deleting"); + + /** Static value Deleted for State. */ + public static final State DELETED = fromString("Deleted"); + + /** Static value Stopping for State. */ + public static final State STOPPING = fromString("Stopping"); + + /** Static value Stopped for State. */ + public static final State STOPPED = fromString("Stopped"); + + /** Static value Starting for State. */ + public static final State STARTING = fromString("Starting"); + + /** Static value Updating for State. */ + public static final State UPDATING = fromString("Updating"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** @return known State values. */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TableLevelSharingProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TableLevelSharingProperties.java new file mode 100644 index 0000000000000..39e78a6bfed3f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TableLevelSharingProperties.java @@ -0,0 +1,181 @@ +// 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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Tables that will be included and excluded in the follower database. */ +@Fluent +public final class TableLevelSharingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TableLevelSharingProperties.class); + + /* + * List of tables to include in the follower database + */ + @JsonProperty(value = "tablesToInclude") + private List tablesToInclude; + + /* + * List of tables to exclude from the follower database + */ + @JsonProperty(value = "tablesToExclude") + private List tablesToExclude; + + /* + * List of external tables to include in the follower database + */ + @JsonProperty(value = "externalTablesToInclude") + private List externalTablesToInclude; + + /* + * List of external tables exclude from the follower database + */ + @JsonProperty(value = "externalTablesToExclude") + private List externalTablesToExclude; + + /* + * List of materialized views to include in the follower database + */ + @JsonProperty(value = "materializedViewsToInclude") + private List materializedViewsToInclude; + + /* + * List of materialized views exclude from the follower database + */ + @JsonProperty(value = "materializedViewsToExclude") + private List materializedViewsToExclude; + + /** + * Get the tablesToInclude property: List of tables to include in the follower database. + * + * @return the tablesToInclude value. + */ + public List tablesToInclude() { + return this.tablesToInclude; + } + + /** + * Set the tablesToInclude property: List of tables to include in the follower database. + * + * @param tablesToInclude the tablesToInclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withTablesToInclude(List tablesToInclude) { + this.tablesToInclude = tablesToInclude; + return this; + } + + /** + * Get the tablesToExclude property: List of tables to exclude from the follower database. + * + * @return the tablesToExclude value. + */ + public List tablesToExclude() { + return this.tablesToExclude; + } + + /** + * Set the tablesToExclude property: List of tables to exclude from the follower database. + * + * @param tablesToExclude the tablesToExclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withTablesToExclude(List tablesToExclude) { + this.tablesToExclude = tablesToExclude; + return this; + } + + /** + * Get the externalTablesToInclude property: List of external tables to include in the follower database. + * + * @return the externalTablesToInclude value. + */ + public List externalTablesToInclude() { + return this.externalTablesToInclude; + } + + /** + * Set the externalTablesToInclude property: List of external tables to include in the follower database. + * + * @param externalTablesToInclude the externalTablesToInclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withExternalTablesToInclude(List externalTablesToInclude) { + this.externalTablesToInclude = externalTablesToInclude; + return this; + } + + /** + * Get the externalTablesToExclude property: List of external tables exclude from the follower database. + * + * @return the externalTablesToExclude value. + */ + public List externalTablesToExclude() { + return this.externalTablesToExclude; + } + + /** + * Set the externalTablesToExclude property: List of external tables exclude from the follower database. + * + * @param externalTablesToExclude the externalTablesToExclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withExternalTablesToExclude(List externalTablesToExclude) { + this.externalTablesToExclude = externalTablesToExclude; + return this; + } + + /** + * Get the materializedViewsToInclude property: List of materialized views to include in the follower database. + * + * @return the materializedViewsToInclude value. + */ + public List materializedViewsToInclude() { + return this.materializedViewsToInclude; + } + + /** + * Set the materializedViewsToInclude property: List of materialized views to include in the follower database. + * + * @param materializedViewsToInclude the materializedViewsToInclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withMaterializedViewsToInclude(List materializedViewsToInclude) { + this.materializedViewsToInclude = materializedViewsToInclude; + return this; + } + + /** + * Get the materializedViewsToExclude property: List of materialized views exclude from the follower database. + * + * @return the materializedViewsToExclude value. + */ + public List materializedViewsToExclude() { + return this.materializedViewsToExclude; + } + + /** + * Set the materializedViewsToExclude property: List of materialized views exclude from the follower database. + * + * @param materializedViewsToExclude the materializedViewsToExclude value to set. + * @return the TableLevelSharingProperties object itself. + */ + public TableLevelSharingProperties withMaterializedViewsToExclude(List materializedViewsToExclude) { + this.materializedViewsToExclude = materializedViewsToExclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Type.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Type.java new file mode 100644 index 0000000000000..44c9936bad0c8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Type.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Type. */ +public enum Type { + /** Enum value Microsoft.Synapse/workspaces/kustoPools/databases. */ + MICROSOFT_SYNAPSE_WORKSPACES_KUSTO_POOLS_DATABASES("Microsoft.Synapse/workspaces/kustoPools/databases"), + + /** Enum value Microsoft.Synapse/workspaces/kustoPools/attachedDatabaseConfigurations. */ + MICROSOFT_SYNAPSE_WORKSPACES_KUSTO_POOLS_ATTACHED_DATABASE_CONFIGURATIONS( + "Microsoft.Synapse/workspaces/kustoPools/attachedDatabaseConfigurations"); + + /** The actual serialized value for a Type instance. */ + private final String value; + + Type(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Type instance. + * + * @param value the serialized value to parse. + * @return the parsed Type object, or null if unable to parse. + */ + @JsonCreator + public static Type fromString(String value) { + Type[] items = Type.values(); + for (Type item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UserAssignedManagedIdentity.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UserAssignedManagedIdentity.java new file mode 100644 index 0000000000000..e75f2e2c4f0a0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UserAssignedManagedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User Assigned Managed Identity. */ +@Immutable +public class UserAssignedManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedManagedIdentity.class); + + /* + * The client ID. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /** + * Get the clientId property: The client ID. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java index 309877ce02268..47311d45cff88 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java @@ -173,12 +173,19 @@ public interface Workspace { String adlaResourceId(); /** - * Gets the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Gets the publicNetworkAccess property: Enable or Disable public network access to workspace. * * @return the publicNetworkAccess value. */ WorkspacePublicNetworkAccess publicNetworkAccess(); + /** + * Gets the cspWorkspaceAdminProperties property: Initial workspace AAD admin properties for a CSP subscription. + * + * @return the cspWorkspaceAdminProperties value. + */ + CspWorkspaceAdminProperties cspWorkspaceAdminProperties(); + /** * Gets the region of the resource. * @@ -259,7 +266,8 @@ interface WithCreate DefinitionStages.WithManagedVirtualNetworkSettings, DefinitionStages.WithWorkspaceRepositoryConfiguration, DefinitionStages.WithPurviewConfiguration, - DefinitionStages.WithPublicNetworkAccess { + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithCspWorkspaceAdminProperties { /** * Executes the create request. * @@ -427,13 +435,24 @@ interface WithPurviewConfiguration { /** The stage of the Workspace definition allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** - * Specifies the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Specifies the publicNetworkAccess property: Enable or Disable public network access to workspace. * - * @param publicNetworkAccess Enable or Disable pubic network access to workspace. + * @param publicNetworkAccess Enable or Disable public network access to workspace. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(WorkspacePublicNetworkAccess publicNetworkAccess); } + /** The stage of the Workspace definition allowing to specify cspWorkspaceAdminProperties. */ + interface WithCspWorkspaceAdminProperties { + /** + * Specifies the cspWorkspaceAdminProperties property: Initial workspace AAD admin properties for a CSP + * subscription. + * + * @param cspWorkspaceAdminProperties Initial workspace AAD admin properties for a CSP subscription. + * @return the next definition stage. + */ + WithCreate withCspWorkspaceAdminProperties(CspWorkspaceAdminProperties cspWorkspaceAdminProperties); + } } /** * Begins update for the Workspace resource. @@ -543,9 +562,9 @@ interface WithEncryption { /** The stage of the Workspace update allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** - * Specifies the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Specifies the publicNetworkAccess property: Enable or Disable public network access to workspace. * - * @param publicNetworkAccess Enable or Disable pubic network access to workspace. + * @param publicNetworkAccess Enable or Disable public network access to workspace. * @return the next definition stage. */ Update withPublicNetworkAccess(WorkspacePublicNetworkAccess publicNetworkAccess); diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java index 47c5bfd5a08d8..6defdc5759d08 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -21,6 +22,7 @@ public class WorkspacePatchInfo { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -66,7 +68,7 @@ public class WorkspacePatchInfo { private EncryptionDetails encryption; /* - * Enable or Disable pubic network access to workspace + * Enable or Disable public network access to workspace */ @JsonProperty(value = "properties.publicNetworkAccess") private WorkspacePublicNetworkAccess publicNetworkAccess; @@ -223,7 +225,7 @@ public WorkspacePatchInfo withEncryption(EncryptionDetails encryption) { } /** - * Get the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Get the publicNetworkAccess property: Enable or Disable public network access to workspace. * * @return the publicNetworkAccess value. */ @@ -232,7 +234,7 @@ public WorkspacePublicNetworkAccess publicNetworkAccess() { } /** - * Set the publicNetworkAccess property: Enable or Disable pubic network access to workspace. + * Set the publicNetworkAccess property: Enable or Disable public network access to workspace. * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspacePatchInfo object itself.