From dbd073e43579c2bedaf18e84a0fd451180dd373b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 26 Oct 2020 05:19:07 +0000 Subject: [PATCH] Generated from a925b597d7462c919a8ae6240e3d34633b275809 --- .../DataMaskingPoliciesOperations.cs | 546 ++++++++++ ...DataMaskingPoliciesOperationsExtensions.cs | 123 +++ .../Generated/DataMaskingRulesOperations.cs | 573 +++++++++++ .../DataMaskingRulesOperationsExtensions.cs | 131 +++ ...edSqlPoolBlobAuditingPoliciesOperations.cs | 971 ++++++++++++++++++ ...lobAuditingPoliciesOperationsExtensions.cs | 203 ++++ .../IDataMaskingPoliciesOperations.cs | 86 ++ .../Generated/IDataMaskingRulesOperations.cs | 90 ++ ...edSqlPoolBlobAuditingPoliciesOperations.cs | 136 +++ .../ISqlPoolBlobAuditingPoliciesOperations.cs | 50 + .../Generated/ISqlPoolColumnsOperations.cs | 64 ++ .../Generated/ISqlPoolSchemasOperations.cs | 31 + .../ISqlPoolSensitivityLabelsOperations.cs | 41 + .../src/Generated/ISqlPoolTablesOperations.cs | 34 + ...bilityAssessmentRuleBaselinesOperations.cs | 36 + ...lVulnerabilityAssessmentScansOperations.cs | 31 + .../src/Generated/ISynapseManagementClient.cs | 20 + .../Models/BigDataPoolResourceInfo.cs | 36 +- .../Generated/Models/DataMaskingFunction.cs | 84 ++ .../src/Generated/Models/DataMaskingPolicy.cs | 127 +++ .../src/Generated/Models/DataMaskingRule.cs | 232 +++++ .../Generated/Models/DataMaskingRuleState.cs | 60 ++ .../src/Generated/Models/DataMaskingState.cs | 60 ++ .../ExtendedSqlPoolBlobAuditingPolicy.cs | 380 +++++++ .../src/Generated/Models/LibraryInfo.cs | 87 ++ .../Models/ManagedVirtualNetworkSettings.cs | 74 ++ .../src/Generated/Models/NodeSize.cs | 1 + .../src/Generated/Models/Page1.cs | 53 + .../Models/SensitivityLabelSource.cs | 60 ++ .../src/Generated/Models/Workspace.cs | 11 +- .../Generated/Models/WorkspacePatchInfo.cs | 11 +- ...ePatchInfoManagedVirtualNetworkSettings.cs | 74 ++ .../SdkInfo_SynapseManagementClient.cs | 15 +- .../SdkInfo_SynapseSqlVManagementClient.cs | 1 - .../SqlPoolBlobAuditingPoliciesOperations.cs | 407 ++++++++ ...lobAuditingPoliciesOperationsExtensions.cs | 80 ++ .../src/Generated/SqlPoolColumnsOperations.cs | 315 ++++++ .../SqlPoolColumnsOperationsExtensions.cs | 89 ++ .../src/Generated/SqlPoolSchemasOperations.cs | 243 +++++ .../SqlPoolSchemasOperationsExtensions.cs | 52 + .../SqlPoolSensitivityLabelsOperations.cs | 267 +++++ ...olSensitivityLabelsOperationsExtensions.cs | 72 ++ .../src/Generated/SqlPoolTablesOperations.cs | 252 +++++ .../SqlPoolTablesOperationsExtensions.cs | 58 ++ ...bilityAssessmentRuleBaselinesOperations.cs | 253 +++++ ...ssmentRuleBaselinesOperationsExtensions.cs | 62 ++ ...lVulnerabilityAssessmentScansOperations.cs | 246 +++++ ...lityAssessmentScansOperationsExtensions.cs | 52 + .../src/Generated/SynapseManagementClient.cs | 24 + 49 files changed, 6987 insertions(+), 17 deletions(-) create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperationsExtensions.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperationsExtensions.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperationsExtensions.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingPoliciesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingRulesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IExtendedSqlPoolBlobAuditingPoliciesOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolColumnsOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingFunction.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingPolicy.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRule.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRuleState.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingState.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ExtendedSqlPoolBlobAuditingPolicy.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/LibraryInfo.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ManagedVirtualNetworkSettings.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Page1.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SensitivityLabelSource.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfoManagedVirtualNetworkSettings.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs create mode 100644 sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperationsExtensions.cs diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs new file mode 100644 index 0000000000000..b1d2487e1189b --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperations.cs @@ -0,0 +1,546 @@ +// +// 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; + + /// + /// DataMaskingPoliciesOperations operations. + /// + internal partial class DataMaskingPoliciesOperations : IServiceOperations, IDataMaskingPoliciesOperations + { + /// + /// Initializes a new instance of the DataMaskingPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataMaskingPoliciesOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Creates or updates a Sql pool data masking policy + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// Parameters for creating or updating a data masking policy. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, DataMaskingPolicy parameters, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + 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(); + } + string dataMaskingPolicyName = "Default"; + // 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("dataMaskingPolicyName", dataMaskingPolicyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/dataMaskingPolicies/{dataMaskingPolicyName}").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)); + _url = _url.Replace("{dataMaskingPolicyName}", System.Uri.EscapeDataString(dataMaskingPolicyName)); + 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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 Sql pool data masking policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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 (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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + string dataMaskingPolicyName = "Default"; + // 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("dataMaskingPolicyName", dataMaskingPolicyName); + 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}/dataMaskingPolicies/{dataMaskingPolicyName}").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)); + _url = _url.Replace("{dataMaskingPolicyName}", System.Uri.EscapeDataString(dataMaskingPolicyName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/DataMaskingPoliciesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperationsExtensions.cs new file mode 100644 index 0000000000000..8f706443000eb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingPoliciesOperationsExtensions.cs @@ -0,0 +1,123 @@ +// +// 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 DataMaskingPoliciesOperations. + /// + public static partial class DataMaskingPoliciesOperationsExtensions + { + /// + /// Creates or updates a Sql pool data masking policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// Parameters for creating or updating a data masking policy. + /// + public static DataMaskingPolicy CreateOrUpdate(this IDataMaskingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, DataMaskingPolicy parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Sql pool data masking policy + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// Parameters for creating or updating a data masking policy. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataMaskingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, DataMaskingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Sql pool data masking policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + public static DataMaskingPolicy Get(this IDataMaskingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Sql pool data masking policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataMaskingPoliciesOperations 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; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs new file mode 100644 index 0000000000000..6b4f917ac6c94 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperations.cs @@ -0,0 +1,573 @@ +// +// 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; + + /// + /// DataMaskingRulesOperations operations. + /// + internal partial class DataMaskingRulesOperations : IServiceOperations, IDataMaskingRulesOperations + { + /// + /// Initializes a new instance of the DataMaskingRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataMaskingRulesOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Creates or updates a Sql pool data masking rule. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the data masking rule. + /// + /// + /// The required parameters for creating or updating a data masking rule. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, string dataMaskingRuleName, DataMaskingRule parameters, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (dataMaskingRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataMaskingRuleName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string dataMaskingPolicyName = "Default"; + // 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("dataMaskingPolicyName", dataMaskingPolicyName); + tracingParameters.Add("dataMaskingRuleName", dataMaskingRuleName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}").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)); + _url = _url.Replace("{dataMaskingPolicyName}", System.Uri.EscapeDataString(dataMaskingPolicyName)); + _url = _url.Replace("{dataMaskingRuleName}", System.Uri.EscapeDataString(dataMaskingRuleName)); + 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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Gets a list of Sql pool data masking rules. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + string dataMaskingPolicyName = "Default"; + // 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("dataMaskingPolicyName", dataMaskingPolicyName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySqlPool", 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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules").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)); + _url = _url.Replace("{dataMaskingPolicyName}", System.Uri.EscapeDataString(dataMaskingPolicyName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/DataMaskingRulesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperationsExtensions.cs new file mode 100644 index 0000000000000..61cc5702cd93c --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataMaskingRulesOperationsExtensions.cs @@ -0,0 +1,131 @@ +// +// 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 DataMaskingRulesOperations. + /// + public static partial class DataMaskingRulesOperationsExtensions + { + /// + /// Creates or updates a Sql pool data masking rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the data masking rule. + /// + /// + /// The required parameters for creating or updating a data masking rule. + /// + public static DataMaskingRule CreateOrUpdate(this IDataMaskingRulesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string dataMaskingRuleName, DataMaskingRule parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Sql pool data masking rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the data masking rule. + /// + /// + /// The required parameters for creating or updating a data masking rule. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataMaskingRulesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string dataMaskingRuleName, DataMaskingRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of Sql pool data masking rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + public static IEnumerable ListBySqlPool(this IDataMaskingRulesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.ListBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Sql pool data masking rules. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySqlPoolAsync(this IDataMaskingRulesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySqlPoolWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs new file mode 100644 index 0000000000000..ed3fca0b2941e --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperations.cs @@ -0,0 +1,971 @@ +// +// 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; + + /// + /// ExtendedSqlPoolBlobAuditingPoliciesOperations operations. + /// + internal partial class ExtendedSqlPoolBlobAuditingPoliciesOperations : IServiceOperations, IExtendedSqlPoolBlobAuditingPoliciesOperations + { + /// + /// Initializes a new instance of the ExtendedSqlPoolBlobAuditingPoliciesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExtendedSqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Gets an extended Sql pool's blob auditing policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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 (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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + string blobAuditingPolicyName = "default"; + // 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("blobAuditingPolicyName", blobAuditingPolicyName); + 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}/extendedAuditingSettings/{blobAuditingPolicyName}").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)); + _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 or updates an extended Sql pool's blob auditing policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The extended Sql pool blob auditing policy. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, ExtendedSqlPoolBlobAuditingPolicy parameters, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + 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(); + } + string blobAuditingPolicyName = "default"; + // 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("blobAuditingPolicyName", blobAuditingPolicyName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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}/extendedAuditingSettings/{blobAuditingPolicyName}").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)); + _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName)); + 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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + // 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, "ListBySqlPool", 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}/extendedAuditingSettings").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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// 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>> ListBySqlPoolNextWithHttpMessagesAsync(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, "ListBySqlPoolNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/ExtendedSqlPoolBlobAuditingPoliciesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperationsExtensions.cs new file mode 100644 index 0000000000000..47b4eaf0dc842 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ExtendedSqlPoolBlobAuditingPoliciesOperationsExtensions.cs @@ -0,0 +1,203 @@ +// +// 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 ExtendedSqlPoolBlobAuditingPoliciesOperations. + /// + public static partial class ExtendedSqlPoolBlobAuditingPoliciesOperationsExtensions + { + /// + /// Gets an extended Sql pool's blob auditing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + public static ExtendedSqlPoolBlobAuditingPolicy Get(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets an extended Sql pool's blob auditing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExtendedSqlPoolBlobAuditingPoliciesOperations 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 or updates an extended Sql pool's blob auditing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The extended Sql pool blob auditing policy. + /// + public static ExtendedSqlPoolBlobAuditingPolicy CreateOrUpdate(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, ExtendedSqlPoolBlobAuditingPolicy parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an extended Sql pool's blob auditing policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The extended Sql pool blob auditing policy. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, ExtendedSqlPoolBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + public static IPage ListBySqlPool(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.ListBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySqlPoolAsync(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySqlPoolWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySqlPoolNext(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string nextPageLink) + { + return operations.ListBySqlPoolNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySqlPoolNextAsync(this IExtendedSqlPoolBlobAuditingPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySqlPoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingPoliciesOperations.cs new file mode 100644 index 0000000000000..b14881d8cb537 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingPoliciesOperations.cs @@ -0,0 +1,86 @@ +// +// 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; + + /// + /// DataMaskingPoliciesOperations operations. + /// + public partial interface IDataMaskingPoliciesOperations + { + /// + /// Creates or updates a Sql pool data masking policy + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// Parameters for creating or updating a data masking policy. + /// + /// + /// 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, DataMaskingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Sql pool data masking policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingRulesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingRulesOperations.cs new file mode 100644 index 0000000000000..d1188c41bc4f8 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataMaskingRulesOperations.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataMaskingRulesOperations operations. + /// + public partial interface IDataMaskingRulesOperations + { + /// + /// Creates or updates a Sql pool data masking rule. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the data masking rule. + /// + /// + /// The required parameters for creating or updating a data masking + /// rule. + /// + /// + /// 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, string dataMaskingRuleName, DataMaskingRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of Sql pool data masking rules. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IExtendedSqlPoolBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IExtendedSqlPoolBlobAuditingPoliciesOperations.cs new file mode 100644 index 0000000000000..3ee44697b8690 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IExtendedSqlPoolBlobAuditingPoliciesOperations.cs @@ -0,0 +1,136 @@ +// +// 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; + + /// + /// ExtendedSqlPoolBlobAuditingPoliciesOperations operations. + /// + public partial interface IExtendedSqlPoolBlobAuditingPoliciesOperations + { + /// + /// Gets an extended Sql pool's blob auditing policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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 or updates an extended Sql pool's blob auditing policy. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The extended Sql pool blob auditing policy. + /// + /// + /// 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, ExtendedSqlPoolBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists extended auditing settings of a Sql pool. + /// + /// + /// 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>> ListBySqlPoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolBlobAuditingPoliciesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolBlobAuditingPoliciesOperations.cs index a63d8148f19c0..47d228a00f386 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolBlobAuditingPoliciesOperations.cs @@ -88,5 +88,55 @@ public partial interface ISqlPoolBlobAuditingPoliciesOperations /// Thrown when a required parameter is null /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, SqlPoolBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// 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>> ListBySqlPoolNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolColumnsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolColumnsOperations.cs new file mode 100644 index 0000000000000..f5a6ee57e4fd5 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolColumnsOperations.cs @@ -0,0 +1,64 @@ +// +// 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; + + /// + /// SqlPoolColumnsOperations operations. + /// + public partial interface ISqlPoolColumnsOperations + { + /// + /// Get Sql pool column + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSchemasOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSchemasOperations.cs index 1275e3cdeba4b..76978e15b7625 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSchemasOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSchemasOperations.cs @@ -59,6 +59,37 @@ public partial interface ISqlPoolSchemasOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get Sql Pool schema + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// 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, string schemaName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets schemas of a given SQL pool /// /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSensitivityLabelsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSensitivityLabelsOperations.cs index 1d63db8fe8197..d244a69d23144 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSensitivityLabelsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolSensitivityLabelsOperations.cs @@ -175,6 +175,47 @@ public partial interface ISqlPoolSensitivityLabelsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the sensitivity label of a given column + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: + /// 'current', 'recommended' + /// + /// + /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Enables sensitivity recommendations on a given column /// (recommendations are enabled by default on all columns) /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolTablesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolTablesOperations.cs index d29e79c40acbb..60bc1ea7ca0d1 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolTablesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolTablesOperations.cs @@ -62,6 +62,40 @@ public partial interface ISqlPoolTablesOperations /// Task>> ListBySchemaWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get Sql pool table + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// 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, string schemaName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets tables of a given schema in a SQL pool /// /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs index 956763da04ac7..cec0078a69669 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs @@ -96,5 +96,41 @@ public partial interface ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations /// Thrown when a required parameter is null /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a SqlPool's vulnerability assessment rule baseline. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment rule ID. + /// + /// + /// The name of the vulnerability assessment rule baseline (default + /// implies a baseline on a Sql pool level rule and master for server + /// level rule). Possible values include: 'master', 'default' + /// + /// + /// 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, string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentScansOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentScansOperations.cs index f5d63b376b12d..58ac6c5927ef2 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentScansOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISqlPoolVulnerabilityAssessmentScansOperations.cs @@ -115,6 +115,37 @@ public partial interface ISqlPoolVulnerabilityAssessmentScansOperations /// Task> ExportWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, string scanId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a vulnerability assessment scan record of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment scan Id of the scan to retrieve. + /// + /// + /// 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, string scanId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Executes a Vulnerability Assessment database scan. /// /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs index 916859248eb98..71bd28dd06aae 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs @@ -184,6 +184,26 @@ public partial interface ISynapseManagementClient : System.IDisposable /// ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations SqlPoolVulnerabilityAssessmentRuleBaselines { get; } + /// + /// Gets the IExtendedSqlPoolBlobAuditingPoliciesOperations. + /// + IExtendedSqlPoolBlobAuditingPoliciesOperations ExtendedSqlPoolBlobAuditingPolicies { get; } + + /// + /// Gets the IDataMaskingPoliciesOperations. + /// + IDataMaskingPoliciesOperations DataMaskingPolicies { get; } + + /// + /// Gets the IDataMaskingRulesOperations. + /// + IDataMaskingRulesOperations DataMaskingRules { get; } + + /// + /// Gets the ISqlPoolColumnsOperations. + /// + ISqlPoolColumnsOperations SqlPoolColumns { get; } + /// /// Gets the IWorkspacesOperations. /// 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 c96ede82134f1..dd538bf14728f 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 @@ -54,21 +54,27 @@ public BigDataPoolResourceInfo() /// Auto-pausing properties /// Whether compute isolation /// is required or not. + /// Whether session level + /// library/package management is enabled or not. /// The Spark events folder /// The number of nodes in the Big Data /// pool. /// Library version /// requirements + /// List of custom libraries/packages + /// associated with the spark pool. + /// Spark configuration file to + /// specify additional properties /// The Apache Spark version. /// The default folder where Spark /// logs will be written. /// The level of compute power that each node in /// the Big Data pool has. Possible values include: 'None', 'Small', - /// 'Medium', 'Large', 'XLarge', 'XXLarge' + /// 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge' /// The kind of nodes that the Big Data /// pool provides. Possible values include: 'None', /// 'MemoryOptimized' - 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?), string sparkEventsFolder = default(string), int? nodeCount = default(int?), LibraryRequirements libraryRequirements = default(LibraryRequirements), string sparkVersion = default(string), string defaultSparkLogFolder = default(string), string nodeSize = default(string), string nodeSizeFamily = default(string)) + 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?), 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)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -76,9 +82,12 @@ public BigDataPoolResourceInfo() CreationDate = creationDate; AutoPause = autoPause; IsComputeIsolationEnabled = isComputeIsolationEnabled; + SessionLevelPackagesEnabled = sessionLevelPackagesEnabled; SparkEventsFolder = sparkEventsFolder; NodeCount = nodeCount; LibraryRequirements = libraryRequirements; + CustomLibraries = customLibraries; + SparkConfigProperties = sparkConfigProperties; SparkVersion = sparkVersion; DefaultSparkLogFolder = defaultSparkLogFolder; NodeSize = nodeSize; @@ -121,6 +130,13 @@ public BigDataPoolResourceInfo() [JsonProperty(PropertyName = "properties.isComputeIsolationEnabled")] public bool? IsComputeIsolationEnabled { get; set; } + /// + /// Gets or sets whether session level library/package management is + /// enabled or not. + /// + [JsonProperty(PropertyName = "properties.sessionLevelPackagesEnabled")] + public bool? SessionLevelPackagesEnabled { get; set; } + /// /// Gets or sets the Spark events folder /// @@ -139,6 +155,20 @@ public BigDataPoolResourceInfo() [JsonProperty(PropertyName = "properties.libraryRequirements")] public LibraryRequirements LibraryRequirements { get; set; } + /// + /// Gets or sets list of custom libraries/packages associated with the + /// spark pool. + /// + [JsonProperty(PropertyName = "properties.customLibraries")] + public IList CustomLibraries { get; set; } + + /// + /// Gets or sets spark configuration file to specify additional + /// properties + /// + [JsonProperty(PropertyName = "properties.sparkConfigProperties")] + public LibraryRequirements SparkConfigProperties { get; set; } + /// /// Gets or sets the Apache Spark version. /// @@ -154,7 +184,7 @@ public BigDataPoolResourceInfo() /// /// Gets or sets the level of compute power that each node in the Big /// Data pool has. Possible values include: 'None', 'Small', 'Medium', - /// 'Large', 'XLarge', 'XXLarge' + /// 'Large', 'XLarge', 'XXLarge', 'XXXLarge' /// [JsonProperty(PropertyName = "properties.nodeSize")] public string NodeSize { get; set; } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingFunction.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingFunction.cs new file mode 100644 index 0000000000000..ae1f6ee4ab5f8 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingFunction.cs @@ -0,0 +1,84 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DataMaskingFunction. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DataMaskingFunction + { + [EnumMember(Value = "Default")] + Default, + [EnumMember(Value = "CCN")] + CCN, + [EnumMember(Value = "Email")] + Email, + [EnumMember(Value = "Number")] + Number, + [EnumMember(Value = "SSN")] + SSN, + [EnumMember(Value = "Text")] + Text + } + internal static class DataMaskingFunctionEnumExtension + { + internal static string ToSerializedValue(this DataMaskingFunction? value) + { + return value == null ? null : ((DataMaskingFunction)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DataMaskingFunction value) + { + switch( value ) + { + case DataMaskingFunction.Default: + return "Default"; + case DataMaskingFunction.CCN: + return "CCN"; + case DataMaskingFunction.Email: + return "Email"; + case DataMaskingFunction.Number: + return "Number"; + case DataMaskingFunction.SSN: + return "SSN"; + case DataMaskingFunction.Text: + return "Text"; + } + return null; + } + + internal static DataMaskingFunction? ParseDataMaskingFunction(this string value) + { + switch( value ) + { + case "Default": + return DataMaskingFunction.Default; + case "CCN": + return DataMaskingFunction.CCN; + case "Email": + return DataMaskingFunction.Email; + case "Number": + return DataMaskingFunction.Number; + case "SSN": + return DataMaskingFunction.SSN; + case "Text": + return DataMaskingFunction.Text; + } + return null; + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingPolicy.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingPolicy.cs new file mode 100644 index 0000000000000..765dfa1e6c04d --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingPolicy.cs @@ -0,0 +1,127 @@ +// +// 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.Linq; + + /// + /// Represents a database data masking policy. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataMaskingPolicy : ProxyResource + { + /// + /// Initializes a new instance of the DataMaskingPolicy class. + /// + public DataMaskingPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataMaskingPolicy class. + /// + /// The state of the data masking + /// policy. Possible values include: 'Disabled', 'Enabled' + /// 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. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// The list of the exempt principals. + /// Specifies the semicolon-separated list of database users for which + /// the data masking policy does not apply. The specified users receive + /// data results without masking for all of the database + /// queries. + /// The list of the application + /// principals. This is a legacy parameter and is no longer + /// used. + /// The masking level. This is a legacy + /// parameter and is no longer used. + /// The location of the data masking + /// policy. + /// The kind of data masking policy. Metadata, used + /// for Azure portal. + public DataMaskingPolicy(DataMaskingState dataMaskingState, string id = default(string), string name = default(string), string type = default(string), string exemptPrincipals = default(string), string applicationPrincipals = default(string), string maskingLevel = default(string), string location = default(string), string kind = default(string)) + : base(id, name, type) + { + DataMaskingState = dataMaskingState; + ExemptPrincipals = exemptPrincipals; + ApplicationPrincipals = applicationPrincipals; + MaskingLevel = maskingLevel; + Location = location; + Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state of the data masking policy. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.dataMaskingState")] + public DataMaskingState DataMaskingState { get; set; } + + /// + /// Gets or sets the list of the exempt principals. Specifies the + /// semicolon-separated list of database users for which the data + /// masking policy does not apply. The specified users receive data + /// results without masking for all of the database queries. + /// + [JsonProperty(PropertyName = "properties.exemptPrincipals")] + public string ExemptPrincipals { get; set; } + + /// + /// Gets the list of the application principals. This is a legacy + /// parameter and is no longer used. + /// + [JsonProperty(PropertyName = "properties.applicationPrincipals")] + public string ApplicationPrincipals { get; private set; } + + /// + /// Gets the masking level. This is a legacy parameter and is no longer + /// used. + /// + [JsonProperty(PropertyName = "properties.maskingLevel")] + public string MaskingLevel { get; private set; } + + /// + /// Gets the location of the data masking policy. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets the kind of data masking policy. Metadata, used for Azure + /// portal. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRule.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRule.cs new file mode 100644 index 0000000000000..dd504b0f0bef1 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRule.cs @@ -0,0 +1,232 @@ +// +// 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.Linq; + + /// + /// Represents a Sql pool data masking rule. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataMaskingRule : ProxyResource + { + /// + /// Initializes a new instance of the DataMaskingRule class. + /// + public DataMaskingRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataMaskingRule class. + /// + /// The schema name on which the data masking + /// rule is applied. + /// The table name on which the data masking + /// rule is applied. + /// The column name on which the data masking + /// rule is applied. + /// The masking function that is used for + /// the data masking rule. Possible values include: 'Default', 'CCN', + /// 'Email', 'Number', 'SSN', 'Text' + /// 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. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// The rule Id. + /// The alias name. This is a legacy parameter + /// and is no longer used. + /// The rule state. Used to delete a rule. To + /// delete an existing rule, specify the schemaName, tableName, + /// columnName, maskingFunction, and specify ruleState as disabled. + /// However, if the rule doesn't already exist, the rule will be + /// created with ruleState set to enabled, regardless of the provided + /// value of ruleState. Possible values include: 'Disabled', + /// 'Enabled' + /// The numberFrom property of the masking + /// rule. Required if maskingFunction is set to Number, otherwise this + /// parameter will be ignored. + /// The numberTo property of the data masking + /// rule. Required if maskingFunction is set to Number, otherwise this + /// parameter will be ignored. + /// If maskingFunction is set to Text, the + /// number of characters to show unmasked in the beginning of the + /// string. Otherwise, this parameter will be ignored. + /// If maskingFunction is set to Text, the + /// number of characters to show unmasked at the end of the string. + /// Otherwise, this parameter will be ignored. + /// If maskingFunction is set to Text, + /// the character to use for masking the unexposed part of the string. + /// Otherwise, this parameter will be ignored. + /// The location of the data masking + /// rule. + /// The kind of Data Masking Rule. Metadata, used + /// for Azure portal. + public DataMaskingRule(string schemaName, string tableName, string columnName, DataMaskingFunction maskingFunction, string id = default(string), string name = default(string), string type = default(string), string dataMaskingRuleId = default(string), string aliasName = default(string), DataMaskingRuleState? ruleState = default(DataMaskingRuleState?), string numberFrom = default(string), string numberTo = default(string), string prefixSize = default(string), string suffixSize = default(string), string replacementString = default(string), string location = default(string), string kind = default(string)) + : base(id, name, type) + { + DataMaskingRuleId = dataMaskingRuleId; + AliasName = aliasName; + RuleState = ruleState; + SchemaName = schemaName; + TableName = tableName; + ColumnName = columnName; + MaskingFunction = maskingFunction; + NumberFrom = numberFrom; + NumberTo = numberTo; + PrefixSize = prefixSize; + SuffixSize = suffixSize; + ReplacementString = replacementString; + Location = location; + Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the rule Id. + /// + [JsonProperty(PropertyName = "properties.id")] + public string DataMaskingRuleId { get; private set; } + + /// + /// Gets or sets the alias name. This is a legacy parameter and is no + /// longer used. + /// + [JsonProperty(PropertyName = "properties.aliasName")] + public string AliasName { get; set; } + + /// + /// Gets or sets the rule state. Used to delete a rule. To delete an + /// existing rule, specify the schemaName, tableName, columnName, + /// maskingFunction, and specify ruleState as disabled. However, if the + /// rule doesn't already exist, the rule will be created with ruleState + /// set to enabled, regardless of the provided value of ruleState. + /// Possible values include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.ruleState")] + public DataMaskingRuleState? RuleState { get; set; } + + /// + /// Gets or sets the schema name on which the data masking rule is + /// applied. + /// + [JsonProperty(PropertyName = "properties.schemaName")] + public string SchemaName { get; set; } + + /// + /// Gets or sets the table name on which the data masking rule is + /// applied. + /// + [JsonProperty(PropertyName = "properties.tableName")] + public string TableName { get; set; } + + /// + /// Gets or sets the column name on which the data masking rule is + /// applied. + /// + [JsonProperty(PropertyName = "properties.columnName")] + public string ColumnName { get; set; } + + /// + /// Gets or sets the masking function that is used for the data masking + /// rule. Possible values include: 'Default', 'CCN', 'Email', 'Number', + /// 'SSN', 'Text' + /// + [JsonProperty(PropertyName = "properties.maskingFunction")] + public DataMaskingFunction MaskingFunction { get; set; } + + /// + /// Gets or sets the numberFrom property of the masking rule. Required + /// if maskingFunction is set to Number, otherwise this parameter will + /// be ignored. + /// + [JsonProperty(PropertyName = "properties.numberFrom")] + public string NumberFrom { get; set; } + + /// + /// Gets or sets the numberTo property of the data masking rule. + /// Required if maskingFunction is set to Number, otherwise this + /// parameter will be ignored. + /// + [JsonProperty(PropertyName = "properties.numberTo")] + public string NumberTo { get; set; } + + /// + /// Gets or sets if maskingFunction is set to Text, the number of + /// characters to show unmasked in the beginning of the string. + /// Otherwise, this parameter will be ignored. + /// + [JsonProperty(PropertyName = "properties.prefixSize")] + public string PrefixSize { get; set; } + + /// + /// Gets or sets if maskingFunction is set to Text, the number of + /// characters to show unmasked at the end of the string. Otherwise, + /// this parameter will be ignored. + /// + [JsonProperty(PropertyName = "properties.suffixSize")] + public string SuffixSize { get; set; } + + /// + /// Gets or sets if maskingFunction is set to Text, the character to + /// use for masking the unexposed part of the string. Otherwise, this + /// parameter will be ignored. + /// + [JsonProperty(PropertyName = "properties.replacementString")] + public string ReplacementString { get; set; } + + /// + /// Gets the location of the data masking rule. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets the kind of Data Masking Rule. Metadata, used for Azure + /// portal. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SchemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SchemaName"); + } + if (TableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TableName"); + } + if (ColumnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ColumnName"); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRuleState.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRuleState.cs new file mode 100644 index 0000000000000..83359627f689b --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingRuleState.cs @@ -0,0 +1,60 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DataMaskingRuleState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DataMaskingRuleState + { + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "Enabled")] + Enabled + } + internal static class DataMaskingRuleStateEnumExtension + { + internal static string ToSerializedValue(this DataMaskingRuleState? value) + { + return value == null ? null : ((DataMaskingRuleState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DataMaskingRuleState value) + { + switch( value ) + { + case DataMaskingRuleState.Disabled: + return "Disabled"; + case DataMaskingRuleState.Enabled: + return "Enabled"; + } + return null; + } + + internal static DataMaskingRuleState? ParseDataMaskingRuleState(this string value) + { + switch( value ) + { + case "Disabled": + return DataMaskingRuleState.Disabled; + case "Enabled": + return DataMaskingRuleState.Enabled; + } + return null; + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingState.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingState.cs new file mode 100644 index 0000000000000..11c7a893c40d9 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataMaskingState.cs @@ -0,0 +1,60 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DataMaskingState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DataMaskingState + { + [EnumMember(Value = "Disabled")] + Disabled, + [EnumMember(Value = "Enabled")] + Enabled + } + internal static class DataMaskingStateEnumExtension + { + internal static string ToSerializedValue(this DataMaskingState? value) + { + return value == null ? null : ((DataMaskingState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DataMaskingState value) + { + switch( value ) + { + case DataMaskingState.Disabled: + return "Disabled"; + case DataMaskingState.Enabled: + return "Enabled"; + } + return null; + } + + internal static DataMaskingState? ParseDataMaskingState(this string value) + { + switch( value ) + { + case "Disabled": + return DataMaskingState.Disabled; + case "Enabled": + return DataMaskingState.Enabled; + } + return null; + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ExtendedSqlPoolBlobAuditingPolicy.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ExtendedSqlPoolBlobAuditingPolicy.cs new file mode 100644 index 0000000000000..566091bead9cd --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ExtendedSqlPoolBlobAuditingPolicy.cs @@ -0,0 +1,380 @@ +// +// 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; + + /// + /// An extended Sql pool blob auditing policy. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExtendedSqlPoolBlobAuditingPolicy : ProxyResource + { + /// + /// Initializes a new instance of the ExtendedSqlPoolBlobAuditingPolicy + /// class. + /// + public ExtendedSqlPoolBlobAuditingPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExtendedSqlPoolBlobAuditingPolicy + /// class. + /// + /// Specifies the state of the policy. If state is + /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled are + /// required. Possible values include: 'Enabled', 'Disabled' + /// 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. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// Specifies condition of where + /// clause when creating an audit. + /// Specifies the blob storage endpoint + /// (e.g. https://MyAccount.blob.core.windows.net). If state is + /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled is + /// required. + /// Specifies the identifier key + /// of the auditing storage account. + /// If state is Enabled and storageEndpoint is specified, not + /// specifying the storageAccountAccessKey will use SQL server + /// system-assigned managed identity to access the storage. + /// Prerequisites for using managed identity authentication: + /// 1. Assign SQL Server a system-assigned managed identity in Azure + /// Active Directory (AAD). + /// 2. Grant SQL Server identity access to the storage account by + /// adding 'Storage Blob Data Contributor' RBAC role to the server + /// identity. + /// For more information, see [Auditing to storage using Managed + /// Identity + /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + /// Specifies the number of days to keep in + /// the audit logs in the storage account. + /// Specifies the Actions-Groups + /// and Actions to audit. + /// + /// The recommended set of action groups to use is the following + /// combination - this will audit all the queries and stored procedures + /// executed against the database, as well as successful and failed + /// logins: + /// + /// BATCH_COMPLETED_GROUP, + /// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + /// FAILED_DATABASE_AUTHENTICATION_GROUP. + /// + /// This above combination is also the set that is configured by + /// default when enabling auditing from the Azure portal. + /// + /// The supported action groups to audit are (note: choose only + /// specific groups that cover your auditing needs. Using unnecessary + /// groups could lead to very large quantities of audit records): + /// + /// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + /// BACKUP_RESTORE_GROUP + /// DATABASE_LOGOUT_GROUP + /// DATABASE_OBJECT_CHANGE_GROUP + /// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + /// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + /// DATABASE_OPERATION_GROUP + /// DATABASE_PERMISSION_CHANGE_GROUP + /// DATABASE_PRINCIPAL_CHANGE_GROUP + /// DATABASE_PRINCIPAL_IMPERSONATION_GROUP + /// DATABASE_ROLE_MEMBER_CHANGE_GROUP + /// FAILED_DATABASE_AUTHENTICATION_GROUP + /// SCHEMA_OBJECT_ACCESS_GROUP + /// SCHEMA_OBJECT_CHANGE_GROUP + /// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + /// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + /// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + /// USER_CHANGE_PASSWORD_GROUP + /// BATCH_STARTED_GROUP + /// BATCH_COMPLETED_GROUP + /// + /// These are groups that cover all sql statements and stored + /// procedures executed against the database, and should not be used in + /// combination with other groups as this will result in duplicate + /// audit logs. + /// + /// For more information, see [Database-Level Audit Action + /// Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + /// + /// For Database auditing policy, specific Actions can also be + /// specified (note that Actions cannot be specified for Server + /// auditing policy). The supported actions to audit are: + /// SELECT + /// UPDATE + /// INSERT + /// DELETE + /// EXECUTE + /// RECEIVE + /// REFERENCES + /// + /// The general form for defining an action to be audited is: + /// {action} ON {object} BY {principal} + /// + /// Note that <object> in the above format can refer to an object + /// like a table, view, or stored procedure, or an entire database or + /// schema. For the latter cases, the forms DATABASE::{db_name} and + /// SCHEMA::{schema_name} are used, respectively. + /// + /// For example: + /// SELECT on dbo.myTable by public + /// SELECT on DATABASE::myDatabase by public + /// SELECT on SCHEMA::mySchema by public + /// + /// For more information, see [Database-Level Audit + /// Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + /// Specifies the blob + /// storage subscription Id. + /// Specifies whether + /// storageAccountAccessKey value is the storage's secondary + /// key. + /// Specifies whether audit + /// events are sent to Azure Monitor. + /// In order to send the events to Azure Monitor, specify 'state' as + /// 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + /// + /// When using REST API to configure auditing, Diagnostic Settings with + /// 'SQLSecurityAuditEvents' diagnostic logs category on the database + /// should be also created. + /// Note that for server level audit you should use the 'master' + /// database as {databaseName}. + /// + /// Diagnostic Settings URI format: + /// PUT + /// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + /// + /// For more information, see [Diagnostic Settings REST + /// API](https://go.microsoft.com/fwlink/?linkid=2033207) + /// or [Diagnostic Settings + /// PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + /// + /// Specifies the amount of time in + /// milliseconds that can elapse before audit actions are forced to be + /// processed. + /// The default minimum value is 1000 (1 second). The maximum is + /// 2,147,483,647. + public ExtendedSqlPoolBlobAuditingPolicy(BlobAuditingPolicyState state, string id = default(string), string name = default(string), string type = default(string), string predicateExpression = default(string), string storageEndpoint = default(string), string storageAccountAccessKey = default(string), int? retentionDays = default(int?), IList auditActionsAndGroups = default(IList), System.Guid? storageAccountSubscriptionId = default(System.Guid?), bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?)) + : base(id, name, type) + { + PredicateExpression = predicateExpression; + State = state; + StorageEndpoint = storageEndpoint; + StorageAccountAccessKey = storageAccountAccessKey; + RetentionDays = retentionDays; + AuditActionsAndGroups = auditActionsAndGroups; + StorageAccountSubscriptionId = storageAccountSubscriptionId; + IsStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; + IsAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; + QueueDelayMs = queueDelayMs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies condition of where clause when creating an + /// audit. + /// + [JsonProperty(PropertyName = "properties.predicateExpression")] + public string PredicateExpression { get; set; } + + /// + /// Gets or sets specifies the state of the policy. If state is + /// Enabled, storageEndpoint or isAzureMonitorTargetEnabled are + /// required. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.state")] + public BlobAuditingPolicyState State { get; set; } + + /// + /// Gets or sets specifies the blob storage endpoint (e.g. + /// https://MyAccount.blob.core.windows.net). If state is Enabled, + /// storageEndpoint or isAzureMonitorTargetEnabled is required. + /// + [JsonProperty(PropertyName = "properties.storageEndpoint")] + public string StorageEndpoint { get; set; } + + /// + /// Gets or sets specifies the identifier key of the auditing storage + /// account. + /// If state is Enabled and storageEndpoint is specified, not + /// specifying the storageAccountAccessKey will use SQL server + /// system-assigned managed identity to access the storage. + /// Prerequisites for using managed identity authentication: + /// 1. Assign SQL Server a system-assigned managed identity in Azure + /// Active Directory (AAD). + /// 2. Grant SQL Server identity access to the storage account by + /// adding 'Storage Blob Data Contributor' RBAC role to the server + /// identity. + /// For more information, see [Auditing to storage using Managed + /// Identity + /// authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + /// + [JsonProperty(PropertyName = "properties.storageAccountAccessKey")] + public string StorageAccountAccessKey { get; set; } + + /// + /// Gets or sets specifies the number of days to keep in the audit logs + /// in the storage account. + /// + [JsonProperty(PropertyName = "properties.retentionDays")] + public int? RetentionDays { get; set; } + + /// + /// Gets or sets specifies the Actions-Groups and Actions to audit. + /// + /// The recommended set of action groups to use is the following + /// combination - this will audit all the queries and stored procedures + /// executed against the database, as well as successful and failed + /// logins: + /// + /// BATCH_COMPLETED_GROUP, + /// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + /// FAILED_DATABASE_AUTHENTICATION_GROUP. + /// + /// This above combination is also the set that is configured by + /// default when enabling auditing from the Azure portal. + /// + /// The supported action groups to audit are (note: choose only + /// specific groups that cover your auditing needs. Using unnecessary + /// groups could lead to very large quantities of audit records): + /// + /// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + /// BACKUP_RESTORE_GROUP + /// DATABASE_LOGOUT_GROUP + /// DATABASE_OBJECT_CHANGE_GROUP + /// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + /// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + /// DATABASE_OPERATION_GROUP + /// DATABASE_PERMISSION_CHANGE_GROUP + /// DATABASE_PRINCIPAL_CHANGE_GROUP + /// DATABASE_PRINCIPAL_IMPERSONATION_GROUP + /// DATABASE_ROLE_MEMBER_CHANGE_GROUP + /// FAILED_DATABASE_AUTHENTICATION_GROUP + /// SCHEMA_OBJECT_ACCESS_GROUP + /// SCHEMA_OBJECT_CHANGE_GROUP + /// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + /// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + /// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + /// USER_CHANGE_PASSWORD_GROUP + /// BATCH_STARTED_GROUP + /// BATCH_COMPLETED_GROUP + /// + /// These are groups that cover all sql statements and stored + /// procedures executed against the database, and should not be used in + /// combination with other groups as this will result in duplicate + /// audit logs. + /// + /// For more information, see [Database-Level Audit Action + /// Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + /// + /// For Database auditing policy, specific Actions can also be + /// specified (note that Actions cannot be specified for Server + /// auditing policy). The supported actions to audit are: + /// SELECT + /// UPDATE + /// INSERT + /// DELETE + /// EXECUTE + /// RECEIVE + /// REFERENCES + /// + /// The general form for defining an action to be audited is: + /// {action} ON {object} BY {principal} + /// + /// Note that &lt;object&gt; in the above format can refer to + /// an object like a table, view, or stored procedure, or an entire + /// database or schema. For the latter cases, the forms + /// DATABASE::{db_name} and SCHEMA::{schema_name} are used, + /// respectively. + /// + /// For example: + /// SELECT on dbo.myTable by public + /// SELECT on DATABASE::myDatabase by public + /// SELECT on SCHEMA::mySchema by public + /// + /// For more information, see [Database-Level Audit + /// Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + /// + [JsonProperty(PropertyName = "properties.auditActionsAndGroups")] + public IList AuditActionsAndGroups { get; set; } + + /// + /// Gets or sets specifies the blob storage subscription Id. + /// + [JsonProperty(PropertyName = "properties.storageAccountSubscriptionId")] + public System.Guid? StorageAccountSubscriptionId { get; set; } + + /// + /// Gets or sets specifies whether storageAccountAccessKey value is the + /// storage's secondary key. + /// + [JsonProperty(PropertyName = "properties.isStorageSecondaryKeyInUse")] + public bool? IsStorageSecondaryKeyInUse { get; set; } + + /// + /// Gets or sets specifies whether audit events are sent to Azure + /// Monitor. + /// In order to send the events to Azure Monitor, specify 'state' as + /// 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + /// + /// When using REST API to configure auditing, Diagnostic Settings with + /// 'SQLSecurityAuditEvents' diagnostic logs category on the database + /// should be also created. + /// Note that for server level audit you should use the 'master' + /// database as {databaseName}. + /// + /// Diagnostic Settings URI format: + /// PUT + /// https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + /// + /// For more information, see [Diagnostic Settings REST + /// API](https://go.microsoft.com/fwlink/?linkid=2033207) + /// or [Diagnostic Settings + /// PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + /// + /// + [JsonProperty(PropertyName = "properties.isAzureMonitorTargetEnabled")] + public bool? IsAzureMonitorTargetEnabled { get; set; } + + /// + /// Gets or sets specifies the amount of time in milliseconds that can + /// elapse before audit actions are forced to be processed. + /// The default minimum value is 1000 (1 second). The maximum is + /// 2,147,483,647. + /// + [JsonProperty(PropertyName = "properties.queueDelayMs")] + public int? QueueDelayMs { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/LibraryInfo.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/LibraryInfo.cs new file mode 100644 index 0000000000000..93ff6cc29d7e2 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/LibraryInfo.cs @@ -0,0 +1,87 @@ +// +// 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; + + /// + /// Information about a library/package created at the workspace level. + /// + /// + /// Library/package information of a Big Data pool powered by Apache Spark + /// + public partial class LibraryInfo + { + /// + /// Initializes a new instance of the LibraryInfo class. + /// + public LibraryInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LibraryInfo class. + /// + /// Name of the library. + /// Storage blob path of library. + /// Storage blob container name. + /// The last update time of the + /// library. + /// Type of the library. + public LibraryInfo(string name = default(string), string path = default(string), string containerName = default(string), System.DateTime? uploadedTimestamp = default(System.DateTime?), string type = default(string)) + { + Name = name; + Path = path; + ContainerName = containerName; + UploadedTimestamp = uploadedTimestamp; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the library. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets storage blob path of library. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Gets or sets storage blob container name. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets the last update time of the library. + /// + [JsonProperty(PropertyName = "uploadedTimestamp")] + public System.DateTime? UploadedTimestamp { get; set; } + + /// + /// Gets or sets type of the library. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ManagedVirtualNetworkSettings.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ManagedVirtualNetworkSettings.cs new file mode 100644 index 0000000000000..f9cee2cc32e80 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ManagedVirtualNetworkSettings.cs @@ -0,0 +1,74 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Managed Virtual Network Settings + /// + public partial class ManagedVirtualNetworkSettings + { + /// + /// Initializes a new instance of the ManagedVirtualNetworkSettings + /// class. + /// + public ManagedVirtualNetworkSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedVirtualNetworkSettings + /// class. + /// + /// Prevent Data + /// Exfiltration + /// Linked Access Check + /// On Target Resource + /// Allowed Aad Tenant Ids + /// For Linking + public ManagedVirtualNetworkSettings(bool? preventDataExfiltration = default(bool?), bool? linkedAccessCheckOnTargetResource = default(bool?), IList allowedAadTenantIdsForLinking = default(IList)) + { + PreventDataExfiltration = preventDataExfiltration; + LinkedAccessCheckOnTargetResource = linkedAccessCheckOnTargetResource; + AllowedAadTenantIdsForLinking = allowedAadTenantIdsForLinking; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets prevent Data Exfiltration + /// + [JsonProperty(PropertyName = "preventDataExfiltration")] + public bool? PreventDataExfiltration { get; set; } + + /// + /// Gets or sets linked Access Check On Target Resource + /// + [JsonProperty(PropertyName = "linkedAccessCheckOnTargetResource")] + public bool? LinkedAccessCheckOnTargetResource { get; set; } + + /// + /// Gets or sets allowed Aad Tenant Ids For Linking + /// + [JsonProperty(PropertyName = "allowedAadTenantIdsForLinking")] + public IList AllowedAadTenantIdsForLinking { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSize.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSize.cs index 49eabdc15a802..933547dbd7f5f 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSize.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/NodeSize.cs @@ -22,5 +22,6 @@ public static class NodeSize public const string Large = "Large"; public const string XLarge = "XLarge"; public const string XXLarge = "XXLarge"; + public const string XXXLarge = "XXXLarge"; } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Page1.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Page1.cs new file mode 100644 index 0000000000000..e22a0aecfa585 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SensitivityLabelSource.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SensitivityLabelSource.cs new file mode 100644 index 0000000000000..1b6a4f2f559bf --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SensitivityLabelSource.cs @@ -0,0 +1,60 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SensitivityLabelSource. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SensitivityLabelSource + { + [EnumMember(Value = "current")] + Current, + [EnumMember(Value = "recommended")] + Recommended + } + internal static class SensitivityLabelSourceEnumExtension + { + internal static string ToSerializedValue(this SensitivityLabelSource? value) + { + return value == null ? null : ((SensitivityLabelSource)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SensitivityLabelSource value) + { + switch( value ) + { + case SensitivityLabelSource.Current: + return "current"; + case SensitivityLabelSource.Recommended: + return "recommended"; + } + return null; + } + + internal static SensitivityLabelSource? ParseSensitivityLabelSource(this string value) + { + switch( value ) + { + case "current": + return SensitivityLabelSource.Current; + case "recommended": + return SensitivityLabelSource.Recommended; + } + return null; + } + } +} 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 3135cac34f4eb..c642961e92081 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 @@ -65,8 +65,10 @@ public Workspace() /// connections to the workspace /// Workspace level configs and feature /// flags + /// Managed Virtual Network + /// Settings /// Identity of the workspace - public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), DataLakeStorageAccountDetails defaultDataLakeStorage = default(DataLakeStorageAccountDetails), string sqlAdministratorLoginPassword = default(string), string managedResourceGroupName = default(string), string provisioningState = default(string), string sqlAdministratorLogin = default(string), VirtualNetworkProfile virtualNetworkProfile = default(VirtualNetworkProfile), IDictionary connectivityEndpoints = default(IDictionary), string managedVirtualNetwork = default(string), IList privateEndpointConnections = default(IList), IDictionary extraProperties = default(IDictionary), ManagedIdentity identity = default(ManagedIdentity)) + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), DataLakeStorageAccountDetails defaultDataLakeStorage = default(DataLakeStorageAccountDetails), string sqlAdministratorLoginPassword = default(string), string managedResourceGroupName = default(string), string provisioningState = default(string), string sqlAdministratorLogin = default(string), VirtualNetworkProfile virtualNetworkProfile = default(VirtualNetworkProfile), IDictionary connectivityEndpoints = default(IDictionary), string managedVirtualNetwork = default(string), IList privateEndpointConnections = default(IList), IDictionary extraProperties = default(IDictionary), ManagedVirtualNetworkSettings managedVirtualNetworkSettings = default(ManagedVirtualNetworkSettings), ManagedIdentity identity = default(ManagedIdentity)) : base(location, id, name, type, tags) { DefaultDataLakeStorage = defaultDataLakeStorage; @@ -79,6 +81,7 @@ public Workspace() ManagedVirtualNetwork = managedVirtualNetwork; PrivateEndpointConnections = privateEndpointConnections; ExtraProperties = extraProperties; + ManagedVirtualNetworkSettings = managedVirtualNetworkSettings; Identity = identity; CustomInit(); } @@ -155,6 +158,12 @@ public Workspace() [JsonProperty(PropertyName = "properties.extraProperties")] public IDictionary ExtraProperties { get; private set; } + /// + /// Gets or sets managed Virtual Network Settings + /// + [JsonProperty(PropertyName = "properties.managedVirtualNetworkSettings")] + public ManagedVirtualNetworkSettings ManagedVirtualNetworkSettings { get; set; } + /// /// Gets or sets identity of the workspace /// 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 6e834752ae50a..b8ec70f039750 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 @@ -36,13 +36,16 @@ public WorkspacePatchInfo() /// /// Resource tags /// The identity of the workspace + /// Managed Virtual Network + /// Settings /// SQL administrator login /// password /// Resource provisioning state - public WorkspacePatchInfo(IDictionary tags = default(IDictionary), ManagedIdentity identity = default(ManagedIdentity), string sqlAdministratorLoginPassword = default(string), string provisioningState = default(string)) + public WorkspacePatchInfo(IDictionary tags = default(IDictionary), ManagedIdentity identity = default(ManagedIdentity), WorkspacePatchInfoManagedVirtualNetworkSettings managedVirtualNetworkSettings = default(WorkspacePatchInfoManagedVirtualNetworkSettings), string sqlAdministratorLoginPassword = default(string), string provisioningState = default(string)) { Tags = tags; Identity = identity; + ManagedVirtualNetworkSettings = managedVirtualNetworkSettings; SqlAdministratorLoginPassword = sqlAdministratorLoginPassword; ProvisioningState = provisioningState; CustomInit(); @@ -65,6 +68,12 @@ public WorkspacePatchInfo() [JsonProperty(PropertyName = "identity")] public ManagedIdentity Identity { get; set; } + /// + /// Gets or sets managed Virtual Network Settings + /// + [JsonProperty(PropertyName = "managedVirtualNetworkSettings")] + public WorkspacePatchInfoManagedVirtualNetworkSettings ManagedVirtualNetworkSettings { get; set; } + /// /// Gets or sets SQL administrator login password /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfoManagedVirtualNetworkSettings.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfoManagedVirtualNetworkSettings.cs new file mode 100644 index 0000000000000..15a2dc0d42c74 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/WorkspacePatchInfoManagedVirtualNetworkSettings.cs @@ -0,0 +1,74 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Managed Virtual Network Settings + /// + public partial class WorkspacePatchInfoManagedVirtualNetworkSettings + { + /// + /// Initializes a new instance of the + /// WorkspacePatchInfoManagedVirtualNetworkSettings class. + /// + public WorkspacePatchInfoManagedVirtualNetworkSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// WorkspacePatchInfoManagedVirtualNetworkSettings class. + /// + /// Prevent Data + /// Exfiltration + /// Linked Access Check + /// On Target Resource + /// Allowed Aad Tenant Ids + /// For Linking + public WorkspacePatchInfoManagedVirtualNetworkSettings(bool? preventDataExfiltration = default(bool?), bool? linkedAccessCheckOnTargetResource = default(bool?), IList allowedAadTenantIdsForLinking = default(IList)) + { + PreventDataExfiltration = preventDataExfiltration; + LinkedAccessCheckOnTargetResource = linkedAccessCheckOnTargetResource; + AllowedAadTenantIdsForLinking = allowedAadTenantIdsForLinking; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets prevent Data Exfiltration + /// + [JsonProperty(PropertyName = "preventDataExfiltration")] + public bool? PreventDataExfiltration { get; set; } + + /// + /// Gets or sets linked Access Check On Target Resource + /// + [JsonProperty(PropertyName = "linkedAccessCheckOnTargetResource")] + public bool? LinkedAccessCheckOnTargetResource { get; set; } + + /// + /// Gets or sets allowed Aad Tenant Ids For Linking + /// + [JsonProperty(PropertyName = "allowedAadTenantIdsForLinking")] + public IList AllowedAadTenantIdsForLinking { get; set; } + + } +} 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 9629d211db5c6..04b133ed8a8f5 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 @@ -20,6 +20,9 @@ public static IEnumerable> ApiInfo_SynapseManageme return new Tuple[] { new Tuple("Synapse", "BigDataPools", "2019-06-01-preview"), + new Tuple("Synapse", "DataMaskingPolicies", "2019-06-01-preview"), + new Tuple("Synapse", "DataMaskingRules", "2019-06-01-preview"), + new Tuple("Synapse", "ExtendedSqlPoolBlobAuditingPolicies", "2019-06-01-preview"), new Tuple("Synapse", "IntegrationRuntimeAuthKeys", "2019-06-01-preview"), new Tuple("Synapse", "IntegrationRuntimeConnectionInfos", "2019-06-01-preview"), new Tuple("Synapse", "IntegrationRuntimeCredentials", "2019-06-01-preview"), @@ -35,6 +38,7 @@ public static IEnumerable> ApiInfo_SynapseManageme new Tuple("Synapse", "PrivateLinkHubs", "2019-06-01-preview"), new Tuple("Synapse", "PrivateLinkResources", "2019-06-01-preview"), new Tuple("Synapse", "SqlPoolBlobAuditingPolicies", "2019-06-01-preview"), + new Tuple("Synapse", "SqlPoolColumns", "2019-06-01-preview"), new Tuple("Synapse", "SqlPoolConnectionPolicies", "2019-06-01-preview"), new Tuple("Synapse", "SqlPoolDataWarehouseUserActivities", "2019-06-01-preview"), new Tuple("Synapse", "SqlPoolGeoBackupPolicies", "2019-06-01-preview"), @@ -60,16 +64,5 @@ public static IEnumerable> ApiInfo_SynapseManageme }.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 = "bc527638520f305e53ea106e57b24427c370978e"; - 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 index 55467ab958c7f..0ca731a1cbdb0 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseSqlVManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseSqlVManagementClient.cs @@ -27,4 +27,3 @@ public static IEnumerable> ApiInfo_SynapseSqlVMana } } } - 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 e378d4c0f77e5..e21fe10b99d4c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperations.cs @@ -566,5 +566,412 @@ internal SqlPoolBlobAuditingPoliciesOperations(SynapseManagementClient client) return _result; } + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// 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>> ListBySqlPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sqlPoolName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + // 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, "ListBySqlPool", 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}/auditingSettings").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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// 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>> ListBySqlPoolNextWithHttpMessagesAsync(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, "ListBySqlPoolNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/SqlPoolBlobAuditingPoliciesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperationsExtensions.cs index 0ef95433ce331..f444738dc52cc 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolBlobAuditingPoliciesOperationsExtensions.cs @@ -131,5 +131,85 @@ public static SqlPoolBlobAuditingPolicy CreateOrUpdate(this ISqlPoolBlobAuditing } } + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + public static IPage ListBySqlPool(this ISqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName) + { + return operations.ListBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName).GetAwaiter().GetResult(); + } + + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySqlPoolAsync(this ISqlPoolBlobAuditingPoliciesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySqlPoolWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySqlPoolNext(this ISqlPoolBlobAuditingPoliciesOperations operations, string nextPageLink) + { + return operations.ListBySqlPoolNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists auditing settings of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySqlPoolNextAsync(this ISqlPoolBlobAuditingPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySqlPoolNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs new file mode 100644 index 0000000000000..40ab1264c808d --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperations.cs @@ -0,0 +1,315 @@ +// +// 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; + + /// + /// SqlPoolColumnsOperations operations. + /// + internal partial class SqlPoolColumnsOperations : IServiceOperations, ISqlPoolColumnsOperations + { + /// + /// Initializes a new instance of the SqlPoolColumnsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SqlPoolColumnsOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Get Sql pool column + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// 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, string schemaName, string tableName, string columnName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + // 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("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}").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)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/SqlPoolColumnsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperationsExtensions.cs new file mode 100644 index 0000000000000..c1addd39c19c1 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolColumnsOperationsExtensions.cs @@ -0,0 +1,89 @@ +// +// 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 SqlPoolColumnsOperations. + /// + public static partial class SqlPoolColumnsOperationsExtensions + { + /// + /// Get Sql pool column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + public static SqlPoolColumn Get(this ISqlPoolColumnsOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).GetAwaiter().GetResult(); + } + + /// + /// Get Sql pool column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolColumnsOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 38278eb3c3d7d..9175b3eae51aa 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperations.cs @@ -300,6 +300,249 @@ internal SqlPoolSchemasOperations(SynapseManagementClient client) return _result; } + /// + /// Get Sql Pool schema + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// 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, string schemaName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + // 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("schemaName", schemaName); + 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}/schemas/{schemaName}").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)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 schemas of a given SQL pool /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperationsExtensions.cs index 0d69e7b148f6b..e90613867e944 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSchemasOperationsExtensions.cs @@ -80,6 +80,58 @@ public static partial class SqlPoolSchemasOperationsExtensions } } + /// + /// Get Sql Pool schema + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + public static SqlPoolSchema Get(this ISqlPoolSchemasOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName).GetAwaiter().GetResult(); + } + + /// + /// Get Sql Pool schema + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolSchemasOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets schemas of a given SQL pool /// 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 f170f4912af58..506d671ec3bcd 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperations.cs @@ -1105,6 +1105,273 @@ internal SqlPoolSensitivityLabelsOperations(SynapseManagementClient client) return _result; } + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// 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, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (columnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "columnName"); + } + // 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("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("columnName", columnName); + tracingParameters.Add("sensitivityLabelSource", sensitivityLabelSource); + 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}").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)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{columnName}", System.Uri.EscapeDataString(columnName)); + _url = _url.Replace("{sensitivityLabelSource}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sensitivityLabelSource, Client.SerializationSettings).Trim('"'))); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + /// /// Enables sensitivity recommendations on a given column (recommendations are /// enabled by default on all columns) diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperationsExtensions.cs index 7c38f02e8f3ce..3a49a32095d81 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolSensitivityLabelsOperationsExtensions.cs @@ -283,6 +283,78 @@ public static void Delete(this ISqlPoolSensitivityLabelsOperations operations, s (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + public static SensitivityLabel Get(this ISqlPoolSensitivityLabelsOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource).GetAwaiter().GetResult(); + } + + /// + /// Gets the sensitivity label of a given column + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The name of the column. + /// + /// + /// The source of the sensitivity label. Possible values include: 'current', + /// 'recommended' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolSensitivityLabelsOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, string columnName, SensitivityLabelSource sensitivityLabelSource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Enables sensitivity recommendations on a given column (recommendations are /// enabled by default on all columns) 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 8067ab6fee8c7..c7f5beaf1b5be 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperations.cs @@ -309,6 +309,258 @@ internal SqlPoolTablesOperations(SynapseManagementClient client) return _result; } + /// + /// Get Sql pool table + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// 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, string schemaName, string tableName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (schemaName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + // 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("schemaName", schemaName); + tracingParameters.Add("tableName", tableName); + 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}/schemas/{schemaName}/tables/{tableName}").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)); + _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 tables of a given schema in a SQL pool /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperationsExtensions.cs index 2f5b59f795a61..729ff8c49e1d7 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolTablesOperationsExtensions.cs @@ -86,6 +86,64 @@ public static partial class SqlPoolTablesOperationsExtensions } } + /// + /// Get Sql pool table + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + public static SqlPoolTable Get(this ISqlPoolTablesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Get Sql pool table + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The name of the schema. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolTablesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string schemaName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets tables of a given schema in a SQL pool /// 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 ffa92c1742940..80c060ddec900 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.cs @@ -553,5 +553,258 @@ internal SqlPoolVulnerabilityAssessmentRuleBaselinesOperations(SynapseManagement return _result; } + /// + /// Gets a SqlPool's vulnerability assessment rule baseline. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment rule ID. + /// + /// + /// The name of the vulnerability assessment rule baseline (default implies a + /// baseline on a Sql pool level rule and master for server level rule). + /// Possible values include: 'master', 'default' + /// + /// + /// 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, string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (ruleId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleId"); + } + string vulnerabilityAssessmentName = "default"; + // 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("vulnerabilityAssessmentName", vulnerabilityAssessmentName); + tracingParameters.Add("ruleId", ruleId); + tracingParameters.Add("baselineName", baselineName); + 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}").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)); + _url = _url.Replace("{vulnerabilityAssessmentName}", System.Uri.EscapeDataString(vulnerabilityAssessmentName)); + _url = _url.Replace("{ruleId}", System.Uri.EscapeDataString(ruleId)); + _url = _url.Replace("{baselineName}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(baselineName, Client.SerializationSettings).Trim('"'))); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/SqlPoolVulnerabilityAssessmentRuleBaselinesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperationsExtensions.cs index b17ae261cc90c..d146cf80a7548 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentRuleBaselinesOperationsExtensions.cs @@ -148,5 +148,67 @@ public static void Delete(this ISqlPoolVulnerabilityAssessmentRuleBaselinesOpera (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets a SqlPool's vulnerability assessment rule baseline. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment rule ID. + /// + /// + /// The name of the vulnerability assessment rule baseline (default implies a + /// baseline on a Sql pool level rule and master for server level rule). + /// Possible values include: 'master', 'default' + /// + public static SqlPoolVulnerabilityAssessmentRuleBaseline Get(this ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName).GetAwaiter().GetResult(); + } + + /// + /// Gets a SqlPool's vulnerability assessment rule baseline. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment rule ID. + /// + /// + /// The name of the vulnerability assessment rule baseline (default implies a + /// baseline on a Sql pool level rule and master for server level rule). + /// Possible values include: 'master', 'default' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } 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 8b5fc6ed2b663..52f7cd26b8f9f 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperations.cs @@ -583,6 +583,252 @@ internal SqlPoolVulnerabilityAssessmentScansOperations(SynapseManagementClient c return _result; } + /// + /// Gets a vulnerability assessment scan record of a Sql pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment scan Id of the scan to retrieve. + /// + /// + /// 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, string scanId, 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (sqlPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sqlPoolName"); + } + if (scanId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scanId"); + } + string vulnerabilityAssessmentName = "default"; + // 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("vulnerabilityAssessmentName", vulnerabilityAssessmentName); + tracingParameters.Add("scanId", scanId); + 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}").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)); + _url = _url.Replace("{vulnerabilityAssessmentName}", System.Uri.EscapeDataString(vulnerabilityAssessmentName)); + _url = _url.Replace("{scanId}", System.Uri.EscapeDataString(scanId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + /// /// Executes a Vulnerability Assessment database scan. /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperationsExtensions.cs index 29d70ea8d2734..98c9b373a2fb7 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SqlPoolVulnerabilityAssessmentScansOperationsExtensions.cs @@ -176,6 +176,58 @@ public static SqlPoolVulnerabilityAssessmentScansExport Export(this ISqlPoolVuln } } + /// + /// Gets a vulnerability assessment scan record of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment scan Id of the scan to retrieve. + /// + public static VulnerabilityAssessmentScanRecord Get(this ISqlPoolVulnerabilityAssessmentScansOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string scanId) + { + return operations.GetAsync(resourceGroupName, workspaceName, sqlPoolName, scanId).GetAwaiter().GetResult(); + } + + /// + /// Gets a vulnerability assessment scan record of a Sql pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// SQL pool name + /// + /// + /// The vulnerability assessment scan Id of the scan to retrieve. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISqlPoolVulnerabilityAssessmentScansOperations operations, string resourceGroupName, string workspaceName, string sqlPoolName, string scanId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sqlPoolName, scanId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Executes a Vulnerability Assessment database scan. /// 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 e12b44e333df8..e2e6ae8f75388 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs @@ -189,6 +189,26 @@ public partial class SynapseManagementClient : ServiceClient public virtual ISqlPoolVulnerabilityAssessmentRuleBaselinesOperations SqlPoolVulnerabilityAssessmentRuleBaselines { get; private set; } + /// + /// Gets the IExtendedSqlPoolBlobAuditingPoliciesOperations. + /// + public virtual IExtendedSqlPoolBlobAuditingPoliciesOperations ExtendedSqlPoolBlobAuditingPolicies { get; private set; } + + /// + /// Gets the IDataMaskingPoliciesOperations. + /// + public virtual IDataMaskingPoliciesOperations DataMaskingPolicies { get; private set; } + + /// + /// Gets the IDataMaskingRulesOperations. + /// + public virtual IDataMaskingRulesOperations DataMaskingRules { get; private set; } + + /// + /// Gets the ISqlPoolColumnsOperations. + /// + public virtual ISqlPoolColumnsOperations SqlPoolColumns { get; private set; } + /// /// Gets the IWorkspacesOperations. /// @@ -528,6 +548,10 @@ private void Initialize() SqlPoolVulnerabilityAssessmentScans = new SqlPoolVulnerabilityAssessmentScansOperations(this); SqlPoolSecurityAlertPolicies = new SqlPoolSecurityAlertPoliciesOperations(this); SqlPoolVulnerabilityAssessmentRuleBaselines = new SqlPoolVulnerabilityAssessmentRuleBaselinesOperations(this); + ExtendedSqlPoolBlobAuditingPolicies = new ExtendedSqlPoolBlobAuditingPoliciesOperations(this); + DataMaskingPolicies = new DataMaskingPoliciesOperations(this); + DataMaskingRules = new DataMaskingRulesOperations(this); + SqlPoolColumns = new SqlPoolColumnsOperations(this); Workspaces = new WorkspacesOperations(this); WorkspaceAadAdmins = new WorkspaceAadAdminsOperations(this); WorkspaceManagedIdentitySqlControlSettings = new WorkspaceManagedIdentitySqlControlSettingsOperations(this);