diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/BigDataPoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/BigDataPoolsOperations.cs index 0a791798af42..59b95ae19029 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/BigDataPoolsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/BigDataPoolsOperations.cs @@ -124,10 +124,6 @@ internal BigDataPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -359,10 +355,6 @@ internal BigDataPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -661,10 +653,6 @@ internal BigDataPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -893,10 +881,6 @@ internal BigDataPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1163,10 +1147,6 @@ internal BigDataPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs index b13a422f1f95..0d646add9456 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs @@ -124,10 +124,6 @@ internal DataMaskingPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -371,10 +367,6 @@ internal DataMaskingPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs index c931c9557068..ddcda83aa9ee 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs @@ -127,10 +127,6 @@ internal DataMaskingRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -401,10 +397,6 @@ internal DataMaskingRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -639,10 +631,6 @@ internal DataMaskingRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs index ed3fca0b2941..5ecf1d65e6b8 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs @@ -121,10 +121,6 @@ internal ExtendedSqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -361,10 +357,6 @@ internal ExtendedSqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -631,10 +623,6 @@ internal ExtendedSqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs index fa3cb48f2fb3..18923904c4f3 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs @@ -49,6 +49,34 @@ public partial interface IPrivateEndpointConnectionsPrivateLinkHubOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlDatabasesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlDatabasesOperations.cs new file mode 100644 index 000000000000..17710d6e8c4a --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlDatabasesOperations.cs @@ -0,0 +1,276 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlDatabasesOperations operations. + /// + public partial interface ISqlDatabasesOperations + { + /// + /// Gets a SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of sql databases. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of sql databases. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolsV3Operations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolsV3Operations.cs new file mode 100644 index 000000000000..c3efb43a7930 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolsV3Operations.cs @@ -0,0 +1,376 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlPoolsV3Operations operations. + /// + public partial interface ISqlPoolsV3Operations + { + /// + /// Gets a SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing sqlpool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deactivates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeactivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Activates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ActivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of sql pools. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing sqlpool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deactivates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeactivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Activates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginActivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of sql pools. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlV3Operations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlV3Operations.cs new file mode 100644 index 000000000000..78f887fd2fb5 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlV3Operations.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlV3Operations operations. + /// + public partial interface ISqlV3Operations + { + /// + /// All operations + /// + /// + /// Get all available operations + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get operation result + /// + /// + /// Get the result of an operation + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task GetLocationHeaderResultWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get operation status + /// + /// + /// Get the status of an operation + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetAzureAsyncHeaderResultWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseSqlV3ManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseSqlV3ManagementClient.cs new file mode 100644 index 000000000000..38c92d6ad41c --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseSqlV3ManagementClient.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// Azure Synapse Analytics Management Client + /// + public partial interface ISynapseSqlV3ManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set; } + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the ISqlV3Operations. + /// + ISqlV3Operations SqlV3Operations { get; } + + /// + /// Gets the ISqlPoolsV3Operations. + /// + ISqlPoolsV3Operations SqlPoolsV3 { get; } + + /// + /// Gets the ISqlDatabasesOperations. + /// + ISqlDatabasesOperations SqlDatabases { get; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs similarity index 100% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeAuthKeysOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeAuthKeysOperations.cs index a8402ffeb711..3f9ed1f79735 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeAuthKeysOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeAuthKeysOperations.cs @@ -127,10 +127,6 @@ internal IntegrationRuntimeAuthKeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -370,10 +366,6 @@ internal IntegrationRuntimeAuthKeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeConnectionInfosOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeConnectionInfosOperations.cs index 7dc892425931..7a3b705e78d7 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeConnectionInfosOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeConnectionInfosOperations.cs @@ -124,10 +124,6 @@ internal IntegrationRuntimeConnectionInfosOperations(SynapseManagementClient cli { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeCredentialsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeCredentialsOperations.cs index 2790d7d1d208..7aea66cd460c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeCredentialsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeCredentialsOperations.cs @@ -125,10 +125,6 @@ internal IntegrationRuntimeCredentialsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeMonitoringDataOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeMonitoringDataOperations.cs index 266827883f98..b6c9f766d8d1 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeMonitoringDataOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeMonitoringDataOperations.cs @@ -124,10 +124,6 @@ internal IntegrationRuntimeMonitoringDataOperations(SynapseManagementClient clie { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodeIpAddressOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodeIpAddressOperations.cs index cf07fc30e563..984e2384f4ba 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodeIpAddressOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodeIpAddressOperations.cs @@ -127,10 +127,6 @@ internal IntegrationRuntimeNodeIpAddressOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodesOperations.cs index 331e154c6353..375787ce3108 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeNodesOperations.cs @@ -127,10 +127,6 @@ internal IntegrationRuntimeNodesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -371,10 +367,6 @@ internal IntegrationRuntimeNodesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -620,10 +612,6 @@ internal IntegrationRuntimeNodesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeObjectMetadataOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeObjectMetadataOperations.cs index fdcaff385fc0..ea2bd798414d 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeObjectMetadataOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeObjectMetadataOperations.cs @@ -127,10 +127,6 @@ internal IntegrationRuntimeObjectMetadataOperations(SynapseManagementClient clie { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -394,10 +390,6 @@ internal IntegrationRuntimeObjectMetadataOperations(SynapseManagementClient clie { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeStatusOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeStatusOperations.cs index 9f48f1f11bde..f8bd9cf16c08 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeStatusOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimeStatusOperations.cs @@ -124,10 +124,6 @@ internal IntegrationRuntimeStatusOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimesOperations.cs index 7781b05ae602..02fbf9052c83 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IntegrationRuntimesOperations.cs @@ -127,10 +127,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -375,10 +371,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -677,10 +669,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -888,10 +876,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1228,10 +1212,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1481,10 +1461,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1695,10 +1671,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1924,10 +1896,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -2132,10 +2100,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -2340,10 +2304,6 @@ internal IntegrationRuntimesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IpFirewallRulesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IpFirewallRulesOperations.cs index e82aad578d37..0e63bd225e15 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IpFirewallRulesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IpFirewallRulesOperations.cs @@ -118,10 +118,6 @@ internal IpFirewallRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -394,10 +390,6 @@ internal IpFirewallRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -651,10 +643,6 @@ internal IpFirewallRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -909,10 +897,6 @@ internal IpFirewallRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1138,10 +1122,6 @@ internal IpFirewallRulesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KeysOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KeysOperations.cs index d5fb735ba7f0..0e24debc1893 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KeysOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KeysOperations.cs @@ -118,10 +118,6 @@ internal KeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -341,10 +337,6 @@ internal KeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -573,10 +565,6 @@ internal KeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -813,10 +801,6 @@ internal KeysOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibrariesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibrariesOperations.cs index f8a105cb62d3..5b109fdb260b 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibrariesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibrariesOperations.cs @@ -121,10 +121,6 @@ internal LibrariesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibraryOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibraryOperations.cs index b2fa356d5d7e..490fe59fcb3f 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibraryOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/LibraryOperations.cs @@ -124,10 +124,6 @@ internal LibraryOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (libraryName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BigDataPoolResourceInfo.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BigDataPoolResourceInfo.cs index 13c0f7d0d19d..feb9309712a9 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BigDataPoolResourceInfo.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BigDataPoolResourceInfo.cs @@ -75,8 +75,8 @@ public BigDataPoolResourceInfo() /// the Big Data pool has. Possible values include: 'None', 'Small', /// 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge' /// The kind of nodes that the Big Data - /// pool provides. Possible values include: 'None', - /// 'MemoryOptimized' + /// pool provides. Possible values include: 'None', 'MemoryOptimized', + /// 'HardwareAcceleratedFPGA', 'HardwareAcceleratedGPU' /// The time when the Big Data /// pool was updated successfully. public BigDataPoolResourceInfo(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), AutoScaleProperties autoScale = default(AutoScaleProperties), System.DateTime? creationDate = default(System.DateTime?), AutoPauseProperties autoPause = default(AutoPauseProperties), bool? isComputeIsolationEnabled = default(bool?), bool? sessionLevelPackagesEnabled = default(bool?), int? cacheSize = default(int?), DynamicExecutorAllocation dynamicExecutorAllocation = default(DynamicExecutorAllocation), string sparkEventsFolder = default(string), int? nodeCount = default(int?), LibraryRequirements libraryRequirements = default(LibraryRequirements), IList customLibraries = default(IList), LibraryRequirements sparkConfigProperties = default(LibraryRequirements), string sparkVersion = default(string), string defaultSparkLogFolder = default(string), string nodeSize = default(string), string nodeSizeFamily = default(string), System.DateTime? lastSucceededTimestamp = default(System.DateTime?)) @@ -210,7 +210,8 @@ public BigDataPoolResourceInfo() /// /// Gets or sets the kind of nodes that the Big Data pool provides. - /// Possible values include: 'None', 'MemoryOptimized' + /// Possible values include: 'None', 'MemoryOptimized', + /// 'HardwareAcceleratedFPGA', 'HardwareAcceleratedGPU' /// [JsonProperty(PropertyName = "properties.nodeSizeFamily")] public string NodeSizeFamily { get; set; } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContract.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContract.cs new file mode 100644 index 000000000000..8bc001a77f8e --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContract.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details. + /// + /// + /// Contains details when the response code indicates an error. + /// + public partial class ErrorContract + { + /// + /// Initializes a new instance of the ErrorContract class. + /// + public ErrorContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorContract class. + /// + /// The error details. + public ErrorContract(ErrorResponse error = default(ErrorResponse)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error details. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContractException.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContractException.cs new file mode 100644 index 000000000000..3e834982c41c --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorContractException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorContract + /// information. + /// + public partial class ErrorContractException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorContract Body { get; set; } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + public ErrorContractException() + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + public ErrorContractException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + /// Inner exception. + public ErrorContractException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorResponse.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorResponse.cs index 8cc0f7581023..9dcadd9275a2 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorResponse.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ErrorResponse.cs @@ -11,15 +11,17 @@ namespace Microsoft.Azure.Management.Synapse.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Error response + /// Error Response /// /// /// Common error response for all Azure Resource Manager APIs to return /// error details for failed operations. (This also follows the OData error - /// response format.). + /// response format.) /// public partial class ErrorResponse { @@ -34,10 +36,18 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error object. - public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) { - Error = error; + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; CustomInit(); } @@ -47,10 +57,34 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets or sets the error object. + /// Gets the error code. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSizeFamily.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSizeFamily.cs index c7b2597409ea..b2ccd0a28550 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSizeFamily.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSizeFamily.cs @@ -18,5 +18,7 @@ public static class NodeSizeFamily { public const string None = "None"; public const string MemoryOptimized = "MemoryOptimized"; + public const string HardwareAcceleratedFPGA = "HardwareAcceleratedFPGA"; + public const string HardwareAcceleratedGPU = "HardwareAcceleratedGPU"; } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationResource.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationResource.cs index d29748425941..09934811f4ec 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationResource.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationResource.cs @@ -39,7 +39,7 @@ public OperationResource() /// Operation start time /// Completion percentage of the /// operation - public OperationResource(string id = default(string), string name = default(string), string status = default(string), object properties = default(object), ErrorDetail error = default(ErrorDetail), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), double? percentComplete = default(double?)) + public OperationResource(string id = default(string), string name = default(string), string status = default(string), object properties = default(object), ErrorResponse error = default(ErrorResponse), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), double? percentComplete = default(double?)) { Id = id; Name = name; @@ -86,7 +86,7 @@ public OperationResource() /// Gets or sets errors from the operation /// [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } + public ErrorResponse Error { get; set; } /// /// Gets or sets operation start time diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Sku.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Sku.cs index 46daf39eb759..6f5452788f7c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Sku.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Sku.cs @@ -10,15 +10,13 @@ namespace Microsoft.Azure.Management.Synapse.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// - /// Sku + /// An ARM Resource SKU. /// - /// - /// SQL pool SKU - /// public partial class Sku { /// @@ -32,16 +30,14 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The service tier - /// The SKU name - /// If the SKU supports scale out/in then the - /// capacity integer should be included. If scale out/in is not - /// possible for the resource this may be omitted. - public Sku(string tier = default(string), string name = default(string), int? capacity = default(int?)) + /// The name of the SKU, typically, a letter + + /// Number code, e.g. P3. + /// The tier or edition of the particular SKU, e.g. + /// Basic, Premium. + public Sku(string name, string tier = default(string)) { - Tier = tier; Name = name; - Capacity = capacity; + Tier = tier; CustomInit(); } @@ -51,24 +47,31 @@ public Sku() partial void CustomInit(); /// - /// Gets or sets the service tier - /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - - /// - /// Gets or sets the SKU name + /// Gets or sets the name of the SKU, typically, a letter + Number + /// code, e.g. P3. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets if the SKU supports scale out/in then the capacity - /// integer should be included. If scale out/in is not possible for the - /// resource this may be omitted. + /// Gets or sets the tier or edition of the particular SKU, e.g. Basic, + /// Premium. /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabase.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabase.cs new file mode 100644 index 000000000000..8afe1eec4ffe --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabase.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A sql database resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class SqlDatabase : TrackedResource + { + /// + /// Initializes a new instance of the SqlDatabase class. + /// + public SqlDatabase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlDatabase class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// SystemData of SqlDatabase. + /// The collation of the database. + /// Storage redundancy of the database. + /// Possible values include: 'Geo', 'GeoZone', 'Local', 'Zone' + /// The Guid of the database. + /// Status of the database. + public SqlDatabase(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string collation = default(string), string storageRedundancy = default(string), System.Guid? databaseGuid = default(System.Guid?), string status = default(string)) + : base(location, id, name, type, tags) + { + SystemData = systemData; + Collation = collation; + StorageRedundancy = storageRedundancy; + DatabaseGuid = databaseGuid; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets systemData of SqlDatabase. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Gets or sets the collation of the database. + /// + [JsonProperty(PropertyName = "properties.collation")] + public string Collation { get; set; } + + /// + /// Gets or sets storage redundancy of the database. Possible values + /// include: 'Geo', 'GeoZone', 'Local', 'Zone' + /// + [JsonProperty(PropertyName = "properties.storageRedundancy")] + public string StorageRedundancy { get; set; } + + /// + /// Gets the Guid of the database. + /// + [JsonProperty(PropertyName = "properties.databaseGuid")] + public System.Guid? DatabaseGuid { get; private set; } + + /// + /// Gets status of the database. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseStorageRedundancyType.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseStorageRedundancyType.cs new file mode 100644 index 000000000000..d62425e7243f --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseStorageRedundancyType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for SqlDatabaseStorageRedundancyType. + /// + public static class SqlDatabaseStorageRedundancyType + { + public const string Geo = "Geo"; + public const string GeoZone = "GeoZone"; + public const string Local = "Local"; + public const string Zone = "Zone"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseUpdate.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseUpdate.cs new file mode 100644 index 000000000000..625b2eb1c45c --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlDatabaseUpdate.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A sql database resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class SqlDatabaseUpdate + { + /// + /// Initializes a new instance of the SqlDatabaseUpdate class. + /// + public SqlDatabaseUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlDatabaseUpdate class. + /// + /// The collation of the database. + /// Storage redundancy of the database. + /// Possible values include: 'Geo', 'GeoZone', 'Local', 'Zone' + /// The Guid of the database. + /// Status of the database. + /// Resource tags. + public SqlDatabaseUpdate(string collation = default(string), string storageRedundancy = default(string), System.Guid? databaseGuid = default(System.Guid?), string status = default(string), IDictionary tags = default(IDictionary)) + { + Collation = collation; + StorageRedundancy = storageRedundancy; + DatabaseGuid = databaseGuid; + Status = status; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the collation of the database. + /// + [JsonProperty(PropertyName = "properties.collation")] + public string Collation { get; set; } + + /// + /// Gets or sets storage redundancy of the database. Possible values + /// include: 'Geo', 'GeoZone', 'Local', 'Zone' + /// + [JsonProperty(PropertyName = "properties.storageRedundancy")] + public string StorageRedundancy { get; set; } + + /// + /// Gets the Guid of the database. + /// + [JsonProperty(PropertyName = "properties.databaseGuid")] + public System.Guid? DatabaseGuid { get; private set; } + + /// + /// Gets status of the database. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolStatus.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolStatus.cs new file mode 100644 index 000000000000..11ae239a50c9 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolStatus.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for SqlPoolStatus. + /// + public static class SqlPoolStatus + { + public const string Invisible = "Invisible"; + public const string Online = "Online"; + public const string Offline = "Offline"; + public const string Creating = "Creating"; + public const string Inaccessible = "Inaccessible"; + public const string Pausing = "Pausing"; + public const string Paused = "Paused"; + public const string Resuming = "Resuming"; + public const string Scaling = "Scaling"; + public const string Dropping = "Dropping"; + public const string Error = "Error"; + public const string Unknown = "Unknown"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolUpdate.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolUpdate.cs new file mode 100644 index 000000000000..7ff8edbfa5d7 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolUpdate.cs @@ -0,0 +1,146 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A sql pool resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class SqlPoolUpdate + { + /// + /// Initializes a new instance of the SqlPoolUpdate class. + /// + public SqlPoolUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlPoolUpdate class. + /// + /// The name and tier of the SKU. + /// The status of the sql pool. Possible values + /// include: 'Invisible', 'Online', 'Offline', 'Creating', + /// 'Inaccessible', 'Pausing', 'Paused', 'Resuming', 'Scaling', + /// 'Dropping', 'Error', 'Unknown' + /// The Guid of the sql pool. + /// The current service level + /// objective name of the sql pool. + /// The requested service + /// level objective name of the sql pool. + /// The max service level + /// objective name of the sql pool. + /// The period of inactivity in minutes + /// before automatically pausing the sql pool. + /// Indicates whether the sql pool can + /// automatically resume when connection attempts are made. + /// Resource tags. + public SqlPoolUpdate(Sku sku = default(Sku), string status = default(string), System.Guid? sqlPoolGuid = default(System.Guid?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string maxServiceObjectiveName = default(string), int? autoPauseTimer = default(int?), bool? autoResume = default(bool?), IDictionary tags = default(IDictionary)) + { + Sku = sku; + Status = status; + SqlPoolGuid = sqlPoolGuid; + CurrentServiceObjectiveName = currentServiceObjectiveName; + RequestedServiceObjectiveName = requestedServiceObjectiveName; + MaxServiceObjectiveName = maxServiceObjectiveName; + AutoPauseTimer = autoPauseTimer; + AutoResume = autoResume; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name and tier of the SKU. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets the status of the sql pool. Possible values include: + /// 'Invisible', 'Online', 'Offline', 'Creating', 'Inaccessible', + /// 'Pausing', 'Paused', 'Resuming', 'Scaling', 'Dropping', 'Error', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the Guid of the sql pool. + /// + [JsonProperty(PropertyName = "properties.sqlPoolGuid")] + public System.Guid? SqlPoolGuid { get; private set; } + + /// + /// Gets the current service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.currentServiceObjectiveName")] + public string CurrentServiceObjectiveName { get; private set; } + + /// + /// Gets the requested service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.requestedServiceObjectiveName")] + public string RequestedServiceObjectiveName { get; private set; } + + /// + /// Gets or sets the max service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.maxServiceObjectiveName")] + public string MaxServiceObjectiveName { get; set; } + + /// + /// Gets or sets the period of inactivity in minutes before + /// automatically pausing the sql pool. + /// + [JsonProperty(PropertyName = "properties.autoPauseTimer")] + public int? AutoPauseTimer { get; set; } + + /// + /// Gets or sets indicates whether the sql pool can automatically + /// resume when connection attempts are made. + /// + [JsonProperty(PropertyName = "properties.autoResume")] + public bool? AutoResume { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolV3.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolV3.cs new file mode 100644 index 000000000000..942a91e42d90 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SqlPoolV3.cs @@ -0,0 +1,167 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A sql pool resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class SqlPoolV3 : TrackedResource + { + /// + /// Initializes a new instance of the SqlPoolV3 class. + /// + public SqlPoolV3() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlPoolV3 class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The sql pool SKU. The list of SKUs may vary by + /// region and support offer. + /// Kind of SqlPool. + /// SystemData of SqlPool. + /// The status of the sql pool. Possible values + /// include: 'Invisible', 'Online', 'Offline', 'Creating', + /// 'Inaccessible', 'Pausing', 'Paused', 'Resuming', 'Scaling', + /// 'Dropping', 'Error', 'Unknown' + /// The Guid of the sql pool. + /// The current service level + /// objective name of the sql pool. + /// The requested service + /// level objective name of the sql pool. + /// The max service level + /// objective name of the sql pool. + /// The period of inactivity in minutes + /// before automatically pausing the sql pool. + /// Indicates whether the sql pool can + /// automatically resume when connection attempts are made. + public SqlPoolV3(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string kind = default(string), SystemData systemData = default(SystemData), string status = default(string), System.Guid? sqlPoolGuid = default(System.Guid?), string currentServiceObjectiveName = default(string), string requestedServiceObjectiveName = default(string), string maxServiceObjectiveName = default(string), int? autoPauseTimer = default(int?), bool? autoResume = default(bool?)) + : base(location, id, name, type, tags) + { + Sku = sku; + Kind = kind; + SystemData = systemData; + Status = status; + SqlPoolGuid = sqlPoolGuid; + CurrentServiceObjectiveName = currentServiceObjectiveName; + RequestedServiceObjectiveName = requestedServiceObjectiveName; + MaxServiceObjectiveName = maxServiceObjectiveName; + AutoPauseTimer = autoPauseTimer; + AutoResume = autoResume; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sql pool SKU. The list of SKUs may vary by region + /// and support offer. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets kind of SqlPool. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets systemData of SqlPool. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Gets the status of the sql pool. Possible values include: + /// 'Invisible', 'Online', 'Offline', 'Creating', 'Inaccessible', + /// 'Pausing', 'Paused', 'Resuming', 'Scaling', 'Dropping', 'Error', + /// 'Unknown' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the Guid of the sql pool. + /// + [JsonProperty(PropertyName = "properties.sqlPoolGuid")] + public System.Guid? SqlPoolGuid { get; private set; } + + /// + /// Gets the current service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.currentServiceObjectiveName")] + public string CurrentServiceObjectiveName { get; private set; } + + /// + /// Gets the requested service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.requestedServiceObjectiveName")] + public string RequestedServiceObjectiveName { get; private set; } + + /// + /// Gets or sets the max service level objective name of the sql pool. + /// + [JsonProperty(PropertyName = "properties.maxServiceObjectiveName")] + public string MaxServiceObjectiveName { get; set; } + + /// + /// Gets or sets the period of inactivity in minutes before + /// automatically pausing the sql pool. + /// + [JsonProperty(PropertyName = "properties.autoPauseTimer")] + public int? AutoPauseTimer { get; set; } + + /// + /// Gets or sets indicates whether the sql pool can automatically + /// resume when connection attempts are made. + /// + [JsonProperty(PropertyName = "properties.autoResume")] + public bool? AutoResume { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..46993a5f4925 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// ARM System Data. + /// + public partial class SystemData : IResource + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// A string identifier for the identity that + /// created the resource. + /// The type of identity that created the + /// resource: <User|Application|ManagedIdentity|Key>. Possible + /// values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// The timestamp of resource creation + /// (UTC). + /// A string identifier for the identity + /// that last modified the resource. + /// The type of identity that last + /// modified the resource: + /// <User|Application|ManagedIdentity|Key>. Possible values + /// include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of last modification + /// (UTC). + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a string identifier for the identity that created the + /// resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; private set; } + + /// + /// Gets the type of identity that created the resource: + /// &lt;User|Application|ManagedIdentity|Key&gt;. Possible + /// values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; private set; } + + /// + /// Gets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; private set; } + + /// + /// Gets a string identifier for the identity that last modified the + /// resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; private set; } + + /// + /// Gets the type of identity that last modified the resource: + /// &lt;User|Application|ManagedIdentity|Key&gt;. Possible + /// values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; private set; } + + /// + /// Gets the timestamp of last modification (UTC). + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; private set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Workspace.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Workspace.cs index bcdbe53fa14b..350ba1be6c46 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Workspace.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Workspace.cs @@ -74,7 +74,7 @@ public Workspace() /// settings /// Purview Configuration /// The ADLA resource ID. - /// Enable or Disable pubic network + /// Enable or Disable public network /// access to workspace. Possible values include: 'Enabled', /// 'Disabled' /// Identity of the workspace @@ -211,7 +211,7 @@ public Workspace() public string AdlaResourceId { get; private set; } /// - /// Gets or sets enable or Disable pubic network access to workspace. + /// Gets or sets enable or Disable public network access to workspace. /// Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.publicNetworkAccess")] diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfo.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfo.cs index 1d09a652a853..99d1d716438c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfo.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfo.cs @@ -46,7 +46,7 @@ public WorkspacePatchInfo() /// Resource provisioning state /// The encryption details of the /// workspace - /// Enable or Disable pubic network + /// Enable or Disable public network /// access to workspace. Possible values include: 'Enabled', /// 'Disabled' public WorkspacePatchInfo(IDictionary tags = default(IDictionary), ManagedIdentity identity = default(ManagedIdentity), string sqlAdministratorLoginPassword = default(string), ManagedVirtualNetworkSettings managedVirtualNetworkSettings = default(ManagedVirtualNetworkSettings), WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration = default(WorkspaceRepositoryConfiguration), PurviewConfiguration purviewConfiguration = default(PurviewConfiguration), string provisioningState = default(string), EncryptionDetails encryption = default(EncryptionDetails), string publicNetworkAccess = default(string)) @@ -117,7 +117,7 @@ public WorkspacePatchInfo() public EncryptionDetails Encryption { get; set; } /// - /// Gets or sets enable or Disable pubic network access to workspace. + /// Gets or sets enable or Disable public network access to workspace. /// Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.publicNetworkAccess")] diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Operations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Operations.cs index 973190da2d18..aec52ee6bf42 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Operations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Operations.cs @@ -482,10 +482,6 @@ internal Operations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -696,10 +692,6 @@ internal Operations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsOperations.cs index e18fa98c4612..d633a9113eb2 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -121,10 +121,6 @@ internal PrivateEndpointConnectionsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -400,10 +396,6 @@ internal PrivateEndpointConnectionsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -630,10 +622,6 @@ internal PrivateEndpointConnectionsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -884,10 +872,6 @@ internal PrivateEndpointConnectionsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs index 67386f60459d..ab597976ca79 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs @@ -118,10 +118,6 @@ internal PrivateEndpointConnectionsPrivateLinkHubOperations(SynapseManagementCli { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { @@ -270,6 +266,231 @@ internal PrivateEndpointConnectionsPrivateLinkHubOperations(SynapseManagementCli return _result; } + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (privateLinkHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateLinkHubName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateLinkHubName", privateLinkHubName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateLinkHubName}", System.Uri.EscapeDataString(privateLinkHubName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs index 8551af5d0e49..1340c0e2c0ae 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs @@ -61,6 +61,52 @@ public static IPage List(this IPriva } } + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + public static PrivateEndpointConnectionForPrivateLinkHub Get(this IPrivateEndpointConnectionsPrivateLinkHubOperations operations, string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsPrivateLinkHubOperations operations, string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubPrivateLinkResourcesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubPrivateLinkResourcesOperations.cs index de43bc7b73a9..69d7f0e26084 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubPrivateLinkResourcesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubPrivateLinkResourcesOperations.cs @@ -121,10 +121,6 @@ internal PrivateLinkHubPrivateLinkResourcesOperations(SynapseManagementClient cl { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { @@ -347,10 +343,6 @@ internal PrivateLinkHubPrivateLinkResourcesOperations(SynapseManagementClient cl { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubsOperations.cs index 9b6d0ee588af..d79193b0a03a 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkHubsOperations.cs @@ -115,10 +115,6 @@ internal PrivateLinkHubsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -329,10 +325,6 @@ internal PrivateLinkHubsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { @@ -556,10 +548,6 @@ internal PrivateLinkHubsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { @@ -812,10 +800,6 @@ internal PrivateLinkHubsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { @@ -1263,10 +1247,6 @@ internal PrivateLinkHubsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (privateLinkHubName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkResourcesOperations.cs index 91d34ab9dabb..940cfbbdb687 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateLinkResourcesOperations.cs @@ -121,10 +121,6 @@ internal PrivateLinkResourcesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -347,10 +343,6 @@ internal PrivateLinkResourcesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/RestorableDroppedSqlPoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/RestorableDroppedSqlPoolsOperations.cs index 11ab34384d3a..6411f3667485 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/RestorableDroppedSqlPoolsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/RestorableDroppedSqlPoolsOperations.cs @@ -122,10 +122,6 @@ internal RestorableDroppedSqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -348,10 +344,6 @@ internal RestorableDroppedSqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs index 0bd4431f3892..7322272e989a 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs @@ -19,80 +19,69 @@ public static IEnumerable> ApiInfo_SynapseManageme { return new Tuple[] { - new Tuple("Synapse", "BigDataPools", "2021-03-01"), - new Tuple("Synapse", "DataMaskingPolicies", "2021-03-01"), - new Tuple("Synapse", "DataMaskingRules", "2021-03-01"), - new Tuple("Synapse", "ExtendedSqlPoolBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeAuthKeys", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeConnectionInfos", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeCredentials", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeMonitoringData", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeNodeIpAddress", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeNodes", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeObjectMetadata", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeStatus", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimes", "2021-03-01"), - new Tuple("Synapse", "IpFirewallRules", "2021-03-01"), - new Tuple("Synapse", "Keys", "2021-03-01"), - new Tuple("Synapse", "Libraries", "2021-03-01"), - new Tuple("Synapse", "Library", "2021-03-01"), - new Tuple("Synapse", "Operations", "2021-03-01"), - new Tuple("Synapse", "PrivateEndpointConnections", "2021-03-01"), - new Tuple("Synapse", "PrivateEndpointConnectionsPrivateLinkHub", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkHubPrivateLinkResources", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkHubs", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkResources", "2021-03-01"), - new Tuple("Synapse", "RestorableDroppedSqlPools", "2021-03-01"), - new Tuple("Synapse", "SqlPoolBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolColumns", "2021-03-01"), - new Tuple("Synapse", "SqlPoolConnectionPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolDataWarehouseUserActivities", "2021-03-01"), - new Tuple("Synapse", "SqlPoolGeoBackupPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMaintenanceWindowOptions", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMaintenanceWindows", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMetadataSyncConfigs", "2021-03-01"), - new Tuple("Synapse", "SqlPoolOperationResults", "2021-03-01"), - new Tuple("Synapse", "SqlPoolOperations", "2021-03-01"), - new Tuple("Synapse", "SqlPoolRecommendedSensitivityLabels", "2021-03-01"), - new Tuple("Synapse", "SqlPoolReplicationLinks", "2021-03-01"), - new Tuple("Synapse", "SqlPoolRestorePoints", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSchemas", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSecurityAlertPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSensitivityLabels", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTableColumns", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTables", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTransparentDataEncryptions", "2021-03-01"), - new Tuple("Synapse", "SqlPoolUsages", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentRuleBaselines", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentScans", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessments", "2021-03-01"), - new Tuple("Synapse", "SqlPoolWorkloadClassifier", "2021-03-01"), - new Tuple("Synapse", "SqlPoolWorkloadGroup", "2021-03-01"), - new Tuple("Synapse", "SqlPools", "2021-03-01"), - new Tuple("Synapse", "WorkspaceAadAdmins", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedIdentitySqlControlSettings", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerEncryptionProtector", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerExtendedBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerRecoverableSqlPools", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerSecurityAlertPolicy", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerUsages", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerVulnerabilityAssessments", "2021-03-01"), - new Tuple("Synapse", "WorkspaceSqlAadAdmins", "2021-03-01"), - new Tuple("Synapse", "Workspaces", "2021-03-01"), + new Tuple("Synapse", "BigDataPools", "2021-04-01-preview"), + new Tuple("Synapse", "DataMaskingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "DataMaskingRules", "2021-04-01-preview"), + new Tuple("Synapse", "ExtendedSqlPoolBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeAuthKeys", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeConnectionInfos", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeCredentials", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeMonitoringData", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeNodeIpAddress", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeNodes", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeObjectMetadata", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeStatus", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimes", "2021-04-01-preview"), + new Tuple("Synapse", "IpFirewallRules", "2021-04-01-preview"), + new Tuple("Synapse", "Keys", "2021-04-01-preview"), + new Tuple("Synapse", "Libraries", "2021-04-01-preview"), + new Tuple("Synapse", "Library", "2021-04-01-preview"), + new Tuple("Synapse", "Operations", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateEndpointConnections", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateEndpointConnectionsPrivateLinkHub", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkHubPrivateLinkResources", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkHubs", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkResources", "2021-04-01-preview"), + new Tuple("Synapse", "RestorableDroppedSqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolColumns", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolConnectionPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolDataWarehouseUserActivities", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolGeoBackupPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMaintenanceWindowOptions", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMaintenanceWindows", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMetadataSyncConfigs", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolOperationResults", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolOperations", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolRecommendedSensitivityLabels", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolReplicationLinks", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolRestorePoints", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSchemas", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSecurityAlertPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSensitivityLabels", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTableColumns", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTables", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTransparentDataEncryptions", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolUsages", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentRuleBaselines", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentScans", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessments", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolWorkloadClassifier", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolWorkloadGroup", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceAadAdmins", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedIdentitySqlControlSettings", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerEncryptionProtector", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerExtendedBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerRecoverableSqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerSecurityAlertPolicy", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerUsages", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerVulnerabilityAssessments", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceSqlAadAdmins", "2021-04-01-preview"), + new Tuple("Synapse", "Workspaces", "2021-04-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/synapse/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\code\\AzureSDK\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "169c6171bad2f782dc1cd5f23bcb803ce7649b0b"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseSqlVManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseSqlVManagementClient.cs new file mode 100644 index 000000000000..0ca731a1cbdb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseSqlVManagementClient.cs @@ -0,0 +1,29 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_SynapseSqlVManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Synapse", "SqlDatabases", "2020-04-01-preview"), + new Tuple("Synapse", "SqlPoolsV3", "2020-04-01-preview"), + new Tuple("Synapse", "SqlV3Operations", "2020-04-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperations.cs new file mode 100644 index 000000000000..b458c9db68b6 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperations.cs @@ -0,0 +1,1448 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlDatabasesOperations operations. + /// + internal partial class SqlDatabasesOperations : IServiceOperations, ISqlDatabasesOperations + { + /// + /// Initializes a new instance of the SqlDatabasesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SqlDatabasesOperations(SynapseSqlV3ManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseSqlV3ManagementClient + /// + public SynapseSqlV3ManagementClient Client { get; private set; } + + /// + /// Gets a SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlDatabaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlDatabaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlDatabaseName", sqlDatabaseName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlDatabases/{sqlDatabaseName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlDatabaseName}", System.Uri.EscapeDataString(sqlDatabaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an existing database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlDatabases").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlDatabaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlDatabaseName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlDatabaseName", sqlDatabaseName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlDatabases/{sqlDatabaseName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlDatabaseName}", System.Uri.EscapeDataString(sqlDatabaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlDatabaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlDatabaseName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlDatabaseName", sqlDatabaseName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlDatabases/{sqlDatabaseName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlDatabaseName}", System.Uri.EscapeDataString(sqlDatabaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates an existing database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlDatabaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlDatabaseName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlDatabaseName", sqlDatabaseName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlDatabases/{sqlDatabaseName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlDatabaseName}", System.Uri.EscapeDataString(sqlDatabaseName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperationsExtensions.cs new file mode 100644 index 000000000000..816f18b53e72 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlDatabasesOperationsExtensions.cs @@ -0,0 +1,439 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SqlDatabasesOperations. + /// + public static partial class SqlDatabasesOperationsExtensions + { + /// + /// Gets a SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + public static SqlDatabase Get(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlDatabaseName).GetAwaiter().GetResult(); + } + + /// + /// Gets a SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + public static SqlDatabase CreateOrUpdate(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + public static void Delete(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, sqlDatabaseName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + public static SqlDatabase Update(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IPage ListByWorkspace(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + public static SqlDatabase BeginCreateOrUpdate(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a new SqlDatabase or updates an existing SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabase parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + public static void BeginDelete(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, sqlDatabaseName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the SqlDatabase. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + public static SqlDatabase BeginUpdate(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql database. + /// + /// + /// The requested SqlDatabase resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ISqlDatabasesOperations operations, string resourceGroupName, string workspaceName, string sqlDatabaseName, SqlDatabaseUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlDatabaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this ISqlDatabasesOperations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of sql databases. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this ISqlDatabasesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs index e21fe10b99d4..2a1e911f0435 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -367,10 +363,6 @@ internal SqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -637,10 +629,6 @@ internal SqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs index 40ab1264c808..76267a476d16 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs @@ -130,10 +130,6 @@ internal SqlPoolColumnsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolConnectionPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolConnectionPoliciesOperations.cs index 1f3954623233..a75bf622cc99 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolConnectionPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolConnectionPoliciesOperations.cs @@ -125,10 +125,6 @@ internal SqlPoolConnectionPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolDataWarehouseUserActivitiesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolDataWarehouseUserActivitiesOperations.cs index a7d629e722d1..9c45083330c4 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolDataWarehouseUserActivitiesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolDataWarehouseUserActivitiesOperations.cs @@ -125,10 +125,6 @@ internal SqlPoolDataWarehouseUserActivitiesOperations(SynapseManagementClient cl { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolGeoBackupPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolGeoBackupPoliciesOperations.cs index dfe8557cafb8..6cbb161c4c44 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolGeoBackupPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolGeoBackupPoliciesOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolGeoBackupPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -356,10 +352,6 @@ internal SqlPoolGeoBackupPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -624,10 +616,6 @@ internal SqlPoolGeoBackupPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowOptionsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowOptionsOperations.cs index f961829a6730..2447a8cf1879 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowOptionsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowOptionsOperations.cs @@ -127,10 +127,6 @@ internal SqlPoolMaintenanceWindowOptionsOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowsOperations.cs index bc92b314dd18..7e786f33afe0 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMaintenanceWindowsOperations.cs @@ -127,10 +127,6 @@ internal SqlPoolMaintenanceWindowsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -372,10 +368,6 @@ internal SqlPoolMaintenanceWindowsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMetadataSyncConfigsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMetadataSyncConfigsOperations.cs index 05ec255e44b7..6f6aa2efaee3 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMetadataSyncConfigsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolMetadataSyncConfigsOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolMetadataSyncConfigsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -359,10 +355,6 @@ internal SqlPoolMetadataSyncConfigsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperationResultsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperationResultsOperations.cs index 269d80c7ab6f..361908799f24 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperationResultsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperationResultsOperations.cs @@ -127,10 +127,6 @@ internal SqlPoolOperationResultsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperations.cs index 9bb5087d68b8..107912609c1c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRecommendedSensitivityLabelsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRecommendedSensitivityLabelsOperations.cs index efed08972f4d..5addc4ba5928 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRecommendedSensitivityLabelsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRecommendedSensitivityLabelsOperations.cs @@ -121,10 +121,6 @@ internal SqlPoolRecommendedSensitivityLabelsOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolReplicationLinksOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolReplicationLinksOperations.cs index 252175d3ec9f..efae3accc324 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolReplicationLinksOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolReplicationLinksOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolReplicationLinksOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -359,10 +355,6 @@ internal SqlPoolReplicationLinksOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRestorePointsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRestorePointsOperations.cs index a12bd3b998fe..630fcd05ca13 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRestorePointsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolRestorePointsOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolRestorePointsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -384,10 +380,6 @@ internal SqlPoolRestorePointsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -624,10 +616,6 @@ internal SqlPoolRestorePointsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -849,10 +837,6 @@ internal SqlPoolRestorePointsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs index 9175b3eae51a..88b57cf7ac32 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs @@ -128,10 +128,6 @@ internal SqlPoolSchemasOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -374,10 +370,6 @@ internal SqlPoolSchemasOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSecurityAlertPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSecurityAlertPoliciesOperations.cs index cef9e13793ae..9dedd95ed6fc 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSecurityAlertPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSecurityAlertPoliciesOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolSecurityAlertPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -361,10 +357,6 @@ internal SqlPoolSecurityAlertPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -604,10 +596,6 @@ internal SqlPoolSecurityAlertPoliciesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs index 68f5c445e9b0..9f63ce814b83 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs @@ -128,10 +128,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -365,10 +361,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -605,10 +597,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -870,10 +858,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1160,10 +1144,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1410,10 +1390,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1671,10 +1647,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1914,10 +1886,6 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTableColumnsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTableColumnsOperations.cs index 0b1fb2e228db..0cab99d9e124 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTableColumnsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTableColumnsOperations.cs @@ -134,10 +134,6 @@ internal SqlPoolTableColumnsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs index c7f5beaf1b5b..f5207562ddd9 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs @@ -131,10 +131,6 @@ internal SqlPoolTablesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -386,10 +382,6 @@ internal SqlPoolTablesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTransparentDataEncryptionsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTransparentDataEncryptionsOperations.cs index 2ec2557ea9a3..b53116ee32d2 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTransparentDataEncryptionsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTransparentDataEncryptionsOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolTransparentDataEncryptionsOperations(SynapseManagementClient cli { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -363,10 +359,6 @@ internal SqlPoolTransparentDataEncryptionsOperations(SynapseManagementClient cli { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -627,10 +619,6 @@ internal SqlPoolTransparentDataEncryptionsOperations(SynapseManagementClient cli { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolUsagesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolUsagesOperations.cs index 8acd3d0e4d15..4f26616f0e47 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolUsagesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolUsagesOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolUsagesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs index 1008060471f4..902fdaaa3793 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs @@ -132,10 +132,6 @@ internal SqlPoolVulnerabilityAssessmentRuleBaselinesOperations(SynapseManagement { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -397,10 +393,6 @@ internal SqlPoolVulnerabilityAssessmentRuleBaselinesOperations(SynapseManagement { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -632,10 +624,6 @@ internal SqlPoolVulnerabilityAssessmentRuleBaselinesOperations(SynapseManagement { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs index 52f7cd26b8f9..b8474dc62ec5 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolVulnerabilityAssessmentScansOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -393,10 +389,6 @@ internal SqlPoolVulnerabilityAssessmentScansOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -657,10 +649,6 @@ internal SqlPoolVulnerabilityAssessmentScansOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -900,10 +888,6 @@ internal SqlPoolVulnerabilityAssessmentScansOperations(SynapseManagementClient c { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentsOperations.cs index 7395195bd0fe..4f13ce672153 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentsOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolVulnerabilityAssessmentsOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -361,10 +357,6 @@ internal SqlPoolVulnerabilityAssessmentsOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -604,10 +596,6 @@ internal SqlPoolVulnerabilityAssessmentsOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -870,10 +858,6 @@ internal SqlPoolVulnerabilityAssessmentsOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadClassifierOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadClassifierOperations.cs index 59211d471ab5..dda64c2c110e 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadClassifierOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadClassifierOperations.cs @@ -130,10 +130,6 @@ internal SqlPoolWorkloadClassifierOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -453,10 +449,6 @@ internal SqlPoolWorkloadClassifierOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -705,10 +697,6 @@ internal SqlPoolWorkloadClassifierOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -990,10 +978,6 @@ internal SqlPoolWorkloadClassifierOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadGroupOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadGroupOperations.cs index 8ccbff3a2d64..66d1a290bfab 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadGroupOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolWorkloadGroupOperations.cs @@ -127,10 +127,6 @@ internal SqlPoolWorkloadGroupOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -435,10 +431,6 @@ internal SqlPoolWorkloadGroupOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -678,10 +670,6 @@ internal SqlPoolWorkloadGroupOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -954,10 +942,6 @@ internal SqlPoolWorkloadGroupOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsOperations.cs index 9af225c35381..95e5b2eba75b 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsOperations.cs @@ -124,10 +124,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -359,10 +355,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -658,10 +650,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -940,10 +928,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1177,10 +1161,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1424,10 +1404,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1674,10 +1650,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1906,10 +1878,6 @@ internal SqlPoolsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3Operations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3Operations.cs new file mode 100644 index 000000000000..cb338212f6eb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3Operations.cs @@ -0,0 +1,1906 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlPoolsV3Operations operations. + /// + internal partial class SqlPoolsV3Operations : IServiceOperations, ISqlPoolsV3Operations + { + /// + /// Initializes a new instance of the SqlPoolsV3Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SqlPoolsV3Operations(SynapseSqlV3ManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseSqlV3ManagementClient + /// + public SynapseSqlV3ManagementClient Client { get; private set; } + + /// + /// Gets a SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeactivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeactivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Activates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ActivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginActivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeactivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeactivate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/pause").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Activates the SqlPool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginActivateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("sqlPoolName", sqlPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginActivate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/resume").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{sqlPoolName}", System.Uri.EscapeDataString(sqlPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3OperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3OperationsExtensions.cs new file mode 100644 index 000000000000..98c97653bed5 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolsV3OperationsExtensions.cs @@ -0,0 +1,611 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SqlPoolsV3Operations. + /// + public static partial class SqlPoolsV3OperationsExtensions + { + /// + /// Gets a SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static SqlPoolV3 Get(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + public static SqlPoolV3 CreateOrUpdate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void Delete(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + public static SqlPoolV3 Update(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void Deactivate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.DeactivateAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task DeactivateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeactivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Activates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void Activate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.ActivateAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Activates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task ActivateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ActivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IPage ListByWorkspace(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + public static SqlPoolV3 BeginCreateOrUpdate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a new SqlPool or updates an existing SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolV3 parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void BeginDelete(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + public static SqlPoolV3 BeginUpdate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing sqlpool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The requested SqlPool resource state. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolUpdate parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void BeginDeactivate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.BeginDeactivateAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deactivates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeactivateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeactivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Activates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + public static void BeginActivate(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + operations.BeginActivateAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Activates the SqlPool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the sql pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginActivateAsync(this ISqlPoolsV3Operations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginActivateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this ISqlPoolsV3Operations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of sql pools. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this ISqlPoolsV3Operations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3Operations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3Operations.cs new file mode 100644 index 000000000000..70ffdd066375 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3Operations.cs @@ -0,0 +1,646 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SqlV3Operations operations. + /// + internal partial class SqlV3Operations : IServiceOperations, ISqlV3Operations + { + /// + /// Initializes a new instance of the SqlV3Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SqlV3Operations(SynapseSqlV3ManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseSqlV3ManagementClient + /// + public SynapseSqlV3ManagementClient Client { get; private set; } + + /// + /// All operations + /// + /// + /// Get all available operations + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Synapse/operations").ToString(); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get operation result + /// + /// + /// Get the result of an operation + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task GetLocationHeaderResultWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetLocationHeaderResult", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/operationResults/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get operation status + /// + /// + /// Get the status of an operation + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetAzureAsyncHeaderResultWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAzureAsyncHeaderResult", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/operationStatuses/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3OperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3OperationsExtensions.cs new file mode 100644 index 000000000000..7232cbe0552f --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlV3OperationsExtensions.cs @@ -0,0 +1,162 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SqlV3Operations. + /// + public static partial class SqlV3OperationsExtensions + { + /// + /// All operations + /// + /// + /// Get all available operations + /// + /// + /// The operations group for this extension method. + /// + public static IList List(this ISqlV3Operations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// All operations + /// + /// + /// Get all available operations + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISqlV3Operations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get operation result + /// + /// + /// Get the result of an operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + public static void GetLocationHeaderResult(this ISqlV3Operations operations, string resourceGroupName, string workspaceName, string operationId) + { + operations.GetLocationHeaderResultAsync(resourceGroupName, workspaceName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation result + /// + /// + /// Get the result of an operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// The cancellation token. + /// + public static async Task GetLocationHeaderResultAsync(this ISqlV3Operations operations, string resourceGroupName, string workspaceName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.GetLocationHeaderResultWithHttpMessagesAsync(resourceGroupName, workspaceName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get operation status + /// + /// + /// Get the status of an operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + public static OperationResource GetAzureAsyncHeaderResult(this ISqlV3Operations operations, string resourceGroupName, string workspaceName, string operationId) + { + return operations.GetAzureAsyncHeaderResultAsync(resourceGroupName, workspaceName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get operation status + /// + /// + /// Get the status of an operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Operation ID + /// + /// + /// The cancellation token. + /// + public static async Task GetAzureAsyncHeaderResultAsync(this ISqlV3Operations operations, string resourceGroupName, string workspaceName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAzureAsyncHeaderResultWithHttpMessagesAsync(resourceGroupName, workspaceName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs index c835dba8e00e..99b23908e3cc 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs @@ -682,7 +682,7 @@ private void Initialize() WorkspaceManagedIdentitySqlControlSettings = new WorkspaceManagedIdentitySqlControlSettingsOperations(this); RestorableDroppedSqlPools = new RestorableDroppedSqlPoolsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-03-01"; + ApiVersion = "2021-04-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseSqlV3ManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseSqlV3ManagementClient.cs new file mode 100644 index 000000000000..c1110740e78f --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseSqlV3ManagementClient.cs @@ -0,0 +1,372 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + /// + /// Azure Synapse Analytics Management Client + /// + public partial class SynapseSqlV3ManagementClient : ServiceClient, ISynapseSqlV3ManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The ID of the target subscription. + /// + public string SubscriptionId { get; set; } + + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the ISqlV3Operations. + /// + public virtual ISqlV3Operations SqlV3Operations { get; private set; } + + /// + /// Gets the ISqlPoolsV3Operations. + /// + public virtual ISqlPoolsV3Operations SqlPoolsV3 { get; private set; } + + /// + /// Gets the ISqlDatabasesOperations. + /// + public virtual ISqlDatabasesOperations SqlDatabases { get; private set; } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SynapseSqlV3ManagementClient.Dispose(). False: will not dispose provided httpClient + protected SynapseSqlV3ManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SynapseSqlV3ManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected SynapseSqlV3ManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected SynapseSqlV3ManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected SynapseSqlV3ManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SynapseSqlV3ManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling SynapseSqlV3ManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public SynapseSqlV3ManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SynapseSqlV3ManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SynapseSqlV3ManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the SynapseSqlV3ManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public SynapseSqlV3ManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + SqlV3Operations = new SqlV3Operations(this); + SqlPoolsV3 = new SqlPoolsV3Operations(this); + SqlDatabases = new SqlDatabasesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-04-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceAadAdminsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceAadAdminsOperations.cs index 6ecdfbe7c964..0e1a55d4c902 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceAadAdminsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceAadAdminsOperations.cs @@ -118,10 +118,6 @@ internal WorkspaceAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -388,10 +384,6 @@ internal WorkspaceAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -634,10 +626,6 @@ internal WorkspaceAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedIdentitySqlControlSettingsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedIdentitySqlControlSettingsOperations.cs index 0a1ca40a32ae..abd754593b0c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedIdentitySqlControlSettingsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedIdentitySqlControlSettingsOperations.cs @@ -118,10 +118,6 @@ internal WorkspaceManagedIdentitySqlControlSettingsOperations(SynapseManagementC { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -366,10 +362,6 @@ internal WorkspaceManagedIdentitySqlControlSettingsOperations(SynapseManagementC { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.cs index a82b3fc36781..048eacece655 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerBlobAuditingPoliciesOperations(SynapseManageme { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -380,10 +376,6 @@ internal WorkspaceManagedSqlServerBlobAuditingPoliciesOperations(SynapseManageme { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -611,10 +603,6 @@ internal WorkspaceManagedSqlServerBlobAuditingPoliciesOperations(SynapseManageme { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerEncryptionProtectorOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerEncryptionProtectorOperations.cs index 6b9ed5e3b985..a287cb8b5464 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerEncryptionProtectorOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerEncryptionProtectorOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerEncryptionProtectorOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -375,10 +371,6 @@ internal WorkspaceManagedSqlServerEncryptionProtectorOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -631,10 +623,6 @@ internal WorkspaceManagedSqlServerEncryptionProtectorOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -869,10 +857,6 @@ internal WorkspaceManagedSqlServerEncryptionProtectorOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations.cs index 102c2dae28cd..8c98515808b1 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations(Synapse { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -381,10 +377,6 @@ internal WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations(Synapse { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -613,10 +605,6 @@ internal WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations(Synapse { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs similarity index 98% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs index 6872f02c31b9..74465b886c02 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerRecoverableSqlPoolsOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -352,10 +348,6 @@ internal WorkspaceManagedSqlServerRecoverableSqlPoolsOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperationsExtensions.cs similarity index 100% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperationsExtensions.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperationsExtensions.cs diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerSecurityAlertPolicyOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerSecurityAlertPolicyOperations.cs index c85c39fab7be..f74647cbba44 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerSecurityAlertPolicyOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerSecurityAlertPolicyOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerSecurityAlertPolicyOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -380,10 +376,6 @@ internal WorkspaceManagedSqlServerSecurityAlertPolicyOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -611,10 +603,6 @@ internal WorkspaceManagedSqlServerSecurityAlertPolicyOperations(SynapseManagemen { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerUsagesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerUsagesOperations.cs index a23e7d743a72..453960fe1416 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerUsagesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerUsagesOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerUsagesOperations(SynapseManagementClient clien { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations.cs index 56b623b790de..60dadfd465d6 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations.cs @@ -121,10 +121,6 @@ internal WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations(SynapseMana { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -355,10 +351,6 @@ internal WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations(SynapseMana { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -616,10 +608,6 @@ internal WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations(SynapseMana { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -830,10 +818,6 @@ internal WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations(SynapseMana { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceSqlAadAdminsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceSqlAadAdminsOperations.cs index b7dc63362f54..5fcb796ca34d 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceSqlAadAdminsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceSqlAadAdminsOperations.cs @@ -118,10 +118,6 @@ internal WorkspaceSqlAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -388,10 +384,6 @@ internal WorkspaceSqlAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -634,10 +626,6 @@ internal WorkspaceSqlAadAdminsOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspacesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspacesOperations.cs index a58ca5422702..4b6ede54fa11 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspacesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspacesOperations.cs @@ -115,10 +115,6 @@ internal WorkspacesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -329,10 +325,6 @@ internal WorkspacesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -811,10 +803,6 @@ internal WorkspacesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1063,10 +1051,6 @@ internal WorkspacesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) { @@ -1316,10 +1300,6 @@ internal WorkspacesOperations(SynapseManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (workspaceName == null) {