diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperations.cs new file mode 100644 index 000000000000..97f9cda6b571 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperations.cs @@ -0,0 +1,1422 @@ +// +// 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; + + /// + /// DataConnectionsOperations operations. + /// + internal partial class DataConnectionsOperations : IServiceOperations, IDataConnectionsOperations + { + /// + /// Initializes a new instance of the DataConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataConnectionsOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Returns the list of data connections of the given Kusto pool database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", 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}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// 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 kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (dataConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("dataConnectionName", dataConnectionName); + 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}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections/{dataConnectionName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{dataConnectionName}", System.Uri.EscapeDataString(dataConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (dataConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectionName"); + } + 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 (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // 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("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("dataConnectionName", dataConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections/{dataConnectionName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{dataConnectionName}", System.Uri.EscapeDataString(dataConnectionName)); + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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; + } + + /// + /// Updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (dataConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectionName"); + } + 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 (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // 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("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("dataConnectionName", dataConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections/{dataConnectionName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{dataConnectionName}", System.Uri.EscapeDataString(dataConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (dataConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("dataConnectionName", dataConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections/{dataConnectionName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{dataConnectionName}", System.Uri.EscapeDataString(dataConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..66c5422fcb26 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DataConnectionsOperationsExtensions.cs @@ -0,0 +1,503 @@ +// +// 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 DataConnectionsOperations. + /// + public static partial class DataConnectionsOperationsExtensions + { + /// + /// Returns the list of data connections of the given Kusto pool database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + public static IEnumerable ListByDatabase(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName) + { + return operations.ListByDatabaseAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of data connections of the given Kusto pool database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + public static DataConnection Get(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName) + { + return operations.GetAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Returns a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate operation. + /// + public static DataConnection CreateOrUpdate(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update operation. + /// + public static DataConnection Update(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + public static void Delete(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate operation. + /// + public static DataConnection BeginCreateOrUpdate(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update operation. + /// + public static DataConnection BeginUpdate(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a data connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + public static void BeginDelete(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the data connection with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDataConnectionsOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, dataConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperations.cs new file mode 100644 index 000000000000..823033b4e7c1 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperations.cs @@ -0,0 +1,1368 @@ +// +// 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; + + /// + /// DatabasesOperations operations. + /// + internal partial class DatabasesOperations : IServiceOperations, IDatabasesOperations + { + /// + /// Initializes a new instance of the DatabasesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DatabasesOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Returns the list of databases of the given Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByKustoPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByKustoPool", 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}/kustoPools/{kustoPoolName}/databases").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + 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}/kustoPools/{kustoPoolName}/databases/{databaseName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + 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 (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // 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("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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; + } + + /// + /// Updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + 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 (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // 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("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (databaseName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}").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("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperationsExtensions.cs new file mode 100644 index 000000000000..40fc9aa67eb4 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/DatabasesOperationsExtensions.cs @@ -0,0 +1,455 @@ +// +// 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 DatabasesOperations. + /// + public static partial class DatabasesOperationsExtensions + { + /// + /// Returns the list of databases of the given Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + public static IEnumerable ListByKustoPool(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName) + { + return operations.ListByKustoPoolAsync(resourceGroupName, workspaceName, kustoPoolName).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of databases of the given Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByKustoPoolAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByKustoPoolWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + public static Database Get(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName) + { + return operations.GetAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Returns a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate operation. + /// + public static Database CreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update operation. + /// + public static Database Update(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + public static void Delete(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate operation. + /// + public static Database BeginCreateOrUpdate(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update operation. + /// + public static Database BeginUpdate(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + public static void BeginDelete(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the database with the given name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDatabasesOperations operations, string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, kustoPoolName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataConnectionsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataConnectionsOperations.cs new file mode 100644 index 000000000000..4bfd38fc74cb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDataConnectionsOperations.cs @@ -0,0 +1,305 @@ +// +// 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; + + /// + /// DataConnectionsOperations operations. + /// + public partial interface IDataConnectionsOperations + { + /// + /// Returns the list of data connections of the given Kusto pool + /// database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// 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 kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the data connection with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the CreateOrUpdate + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a data connection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The data connection parameters supplied to the Update 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, DataConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the data connection with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The name of the data connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, string dataConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDatabasesOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDatabasesOperations.cs new file mode 100644 index 000000000000..15b224d9766d --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IDatabasesOperations.cs @@ -0,0 +1,278 @@ +// +// 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; + + /// + /// DatabasesOperations operations. + /// + public partial interface IDatabasesOperations + { + /// + /// Returns the list of databases of the given Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByKustoPoolWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the database with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the CreateOrUpdate 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The database parameters supplied to the Update 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Database parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the database with the given name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the database in the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string kustoPoolName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoOperations.cs new file mode 100644 index 000000000000..91ebdffd4158 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoOperations.cs @@ -0,0 +1,70 @@ +// +// 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; + + /// + /// KustoOperations operations. + /// + public partial interface IKustoOperations + { + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoPoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoPoolsOperations.cs new file mode 100644 index 000000000000..9aecf3ca0ecb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IKustoPoolsOperations.cs @@ -0,0 +1,287 @@ +// +// 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; + + /// + /// KustoPoolsOperations operations. + /// + public partial interface IKustoPoolsOperations + { + /// + /// List Kusto pools + /// + /// + /// List all Kusto pools + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 workspaceName, string kustoPoolName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the + /// current Kusto Pool. Specify the last-seen ETag value to prevent + /// accidentally overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent + /// updating an existing Kusto Pool. Other values will result in a 412 + /// Pre-condition Failed response. + /// + /// + /// 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 workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the + /// current Kusto Pool. Specify the last-seen ETag value to prevent + /// accidentally overwriting concurrent changes. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the + /// current Kusto Pool. Specify the last-seen ETag value to prevent + /// accidentally overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent + /// updating an existing Kusto Pool. Other values will result in a 412 + /// Pre-condition Failed response. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the + /// current Kusto Pool. Specify the last-seen ETag value to prevent + /// accidentally overwriting concurrent changes. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs index fa3cb48f2fb3..18923904c4f3 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IPrivateEndpointConnectionsPrivateLinkHubOperations.cs @@ -49,6 +49,34 @@ public partial interface IPrivateEndpointConnectionsPrivateLinkHubOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs index ca3286285424..8b51d2e88ffc 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/ISynapseManagementClient.cs @@ -134,6 +134,26 @@ public partial interface ISynapseManagementClient : System.IDisposable /// IKeysOperations Keys { get; } + /// + /// Gets the IKustoOperations. + /// + IKustoOperations KustoOperations { get; } + + /// + /// Gets the IKustoPoolsOperations. + /// + IKustoPoolsOperations KustoPools { get; } + + /// + /// Gets the IDatabasesOperations. + /// + IDatabasesOperations Databases { get; } + + /// + /// Gets the IDataConnectionsOperations. + /// + IDataConnectionsOperations DataConnections { get; } + /// /// Gets the ILibraryOperations. /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs similarity index 100% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/IWorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperations.cs new file mode 100644 index 000000000000..744197fa1954 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperations.cs @@ -0,0 +1,399 @@ +// +// 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; + + /// + /// KustoOperations operations. + /// + internal partial class KustoOperations : IServiceOperations, IKustoOperations + { + /// + /// Initializes a new instance of the KustoOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal KustoOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// 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>> ListWithHttpMessagesAsync(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); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Synapse/kustooperations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperationsExtensions.cs new file mode 100644 index 000000000000..7f7e5182bdcf --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoOperationsExtensions.cs @@ -0,0 +1,91 @@ +// +// 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 KustoOperations. + /// + public static partial class KustoOperationsExtensions + { + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IKustoOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IKustoOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IKustoOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists available operations for the Kusto sub-resources inside + /// Microsoft.Synapse provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IKustoOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperations.cs new file mode 100644 index 000000000000..8eb7dbce5d1a --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperations.cs @@ -0,0 +1,1378 @@ +// +// 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; + + /// + /// KustoPoolsOperations operations. + /// + internal partial class KustoPoolsOperations : IServiceOperations, IKustoPoolsOperations + { + /// + /// Initializes a new instance of the KustoPoolsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal KustoPoolsOperations(SynapseManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SynapseManagementClient + /// + public SynapseManagementClient Client { get; private set; } + + /// + /// List Kusto pools + /// + /// + /// List all Kusto pools + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.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 (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 (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 (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 workspaceName, string kustoPoolName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + 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 (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + 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}/kustoPools/{kustoPoolName}").ToString(); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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 (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("ifNoneMatch", ifNoneMatch); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}").ToString(); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + if (_httpRequest.Headers.Contains("If-None-Match")) + { + _httpRequest.Headers.Remove("If-None-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); + } + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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; + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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 (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}").ToString(); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string workspaceName, string resourceGroupName, string kustoPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + 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 (kustoPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "kustoPoolName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("kustoPoolName", kustoPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}").ToString(); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{kustoPoolName}", System.Uri.EscapeDataString(kustoPoolName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperationsExtensions.cs new file mode 100644 index 000000000000..5f7a1067c8c2 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/KustoPoolsOperationsExtensions.cs @@ -0,0 +1,471 @@ +// +// 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 KustoPoolsOperations. + /// + public static partial class KustoPoolsOperationsExtensions + { + /// + /// List Kusto pools + /// + /// + /// List all Kusto pools + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + public static KustoPoolListResult ListByWorkspace(this IKustoPoolsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// List Kusto pools + /// + /// + /// List all Kusto pools + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace + /// + /// + /// The cancellation token. + /// + public static async Task ListByWorkspaceAsync(this IKustoPoolsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static KustoPool Get(this IKustoPoolsOperations operations, string workspaceName, string kustoPoolName, string resourceGroupName) + { + return operations.GetAsync(workspaceName, kustoPoolName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IKustoPoolsOperations operations, string workspaceName, string kustoPoolName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(workspaceName, kustoPoolName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + public static KustoPool CreateOrUpdate(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return operations.CreateOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + public static KustoPool Update(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string)) + { + return operations.UpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + public static void Delete(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName) + { + operations.DeleteAsync(workspaceName, resourceGroupName, kustoPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + public static KustoPool BeginCreateOrUpdate(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string)) + { + return operations.BeginCreateOrUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the CreateOrUpdate operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// Set to '*' to allow a new Kusto Pool to be created, but to prevent updating + /// an existing Kusto Pool. Other values will result in a 412 Pre-condition + /// Failed response. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPool parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + public static KustoPool BeginUpdate(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string)) + { + return operations.BeginUpdateAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Update a Kusto Kusto Pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The Kusto pool parameters supplied to the Update operation. + /// + /// + /// The ETag of the Kusto Pool. Omit this value to always overwrite the current + /// Kusto Pool. Specify the last-seen ETag value to prevent accidentally + /// overwriting concurrent changes. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, KustoPoolUpdate parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + public static void BeginDelete(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName) + { + operations.BeginDeleteAsync(workspaceName, resourceGroupName, kustoPoolName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Kusto pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Kusto pool. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IKustoPoolsOperations operations, string workspaceName, string resourceGroupName, string kustoPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(workspaceName, resourceGroupName, kustoPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSku.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSku.cs new file mode 100644 index 000000000000..0105f8c26e38 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSku.cs @@ -0,0 +1,107 @@ +// +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Azure SKU definition. + /// + public partial class AzureSku + { + /// + /// Initializes a new instance of the AzureSku class. + /// + public AzureSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureSku class. + /// + /// SKU name. Possible values include: + /// 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', + /// 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', + /// 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', + /// 'Standard_L16s', 'Standard_L8s_v2', 'Standard_L16s_v2', + /// 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No + /// SLA)_Standard_D11_v2', 'Standard_E64i_v3', 'Standard_E80ids_v4', + /// 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', + /// 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', + /// 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', + /// 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4' + /// SKU tier. Possible values include: 'Basic', + /// 'Standard' + /// The number of instances of the + /// cluster. + public AzureSku(string name, string tier, int? capacity = default(int?)) + { + Name = name; + Capacity = capacity; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets SKU name. Possible values include: + /// 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', + /// 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', + /// 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', + /// 'Standard_L16s', 'Standard_L8s_v2', 'Standard_L16s_v2', + /// 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No + /// SLA)_Standard_D11_v2', 'Standard_E64i_v3', 'Standard_E80ids_v4', + /// 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', + /// 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', + /// 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', + /// 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the number of instances of the cluster. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + /// + /// Gets or sets SKU tier. Possible values include: 'Basic', 'Standard' + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Tier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Tier"); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuName.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuName.cs new file mode 100644 index 000000000000..416c9ec1c3d5 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuName.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for AzureSkuName. + /// + public static class AzureSkuName + { + public const string StandardDS13V21TBPS = "Standard_DS13_v2+1TB_PS"; + public const string StandardDS13V22TBPS = "Standard_DS13_v2+2TB_PS"; + public const string StandardDS14V23TBPS = "Standard_DS14_v2+3TB_PS"; + public const string StandardDS14V24TBPS = "Standard_DS14_v2+4TB_PS"; + public const string StandardD13V2 = "Standard_D13_v2"; + public const string StandardD14V2 = "Standard_D14_v2"; + public const string StandardL8s = "Standard_L8s"; + public const string StandardL16s = "Standard_L16s"; + public const string StandardL8sV2 = "Standard_L8s_v2"; + public const string StandardL16sV2 = "Standard_L16s_v2"; + public const string StandardD11V2 = "Standard_D11_v2"; + public const string StandardD12V2 = "Standard_D12_v2"; + public const string StandardL4s = "Standard_L4s"; + public const string DevNoSLAStandardD11V2 = "Dev(No SLA)_Standard_D11_v2"; + public const string StandardE64iV3 = "Standard_E64i_v3"; + public const string StandardE80idsV4 = "Standard_E80ids_v4"; + public const string StandardE2aV4 = "Standard_E2a_v4"; + public const string StandardE4aV4 = "Standard_E4a_v4"; + public const string StandardE8aV4 = "Standard_E8a_v4"; + public const string StandardE16aV4 = "Standard_E16a_v4"; + public const string StandardE8asV41TBPS = "Standard_E8as_v4+1TB_PS"; + public const string StandardE8asV42TBPS = "Standard_E8as_v4+2TB_PS"; + public const string StandardE16asV43TBPS = "Standard_E16as_v4+3TB_PS"; + public const string StandardE16asV44TBPS = "Standard_E16as_v4+4TB_PS"; + public const string DevNoSLAStandardE2aV4 = "Dev(No SLA)_Standard_E2a_v4"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuTier.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuTier.cs new file mode 100644 index 000000000000..f15274465010 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/AzureSkuTier.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for AzureSkuTier. + /// + public static class AzureSkuTier + { + public const string Basic = "Basic"; + public const string Standard = "Standard"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BlobStorageEventType.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BlobStorageEventType.cs new file mode 100644 index 000000000000..9bda6f87b235 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/BlobStorageEventType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for BlobStorageEventType. + /// + public static class BlobStorageEventType + { + public const string MicrosoftStorageBlobCreated = "Microsoft.Storage.BlobCreated"; + public const string MicrosoftStorageBlobRenamed = "Microsoft.Storage.BlobRenamed"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Compression.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Compression.cs new file mode 100644 index 000000000000..a509f4ead60e --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Compression.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for Compression. + /// + public static class Compression + { + public const string None = "None"; + public const string GZip = "GZip"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/CreatedByType.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..89fe012d60f9 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataConnection.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataConnection.cs new file mode 100644 index 000000000000..7defc0c426ab --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DataConnection.cs @@ -0,0 +1,68 @@ +// +// 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; + + /// + /// Class representing a data connection. + /// + public partial class DataConnection : ProxyResource + { + /// + /// Initializes a new instance of the DataConnection class. + /// + public DataConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataConnection class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public DataConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + Location = location; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Database.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Database.cs new file mode 100644 index 000000000000..8ce2c05d2daf --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Database.cs @@ -0,0 +1,68 @@ +// +// 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; + + /// + /// Class representing a Kusto database. + /// + public partial class Database : ProxyResource + { + /// + /// Initializes a new instance of the Database class. + /// + public Database() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Database class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public Database(string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + Location = location; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DatabaseStatistics.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DatabaseStatistics.cs new file mode 100644 index 000000000000..4e7362e7736f --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/DatabaseStatistics.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 Newtonsoft.Json; + using System.Linq; + + /// + /// A class that contains database statistics information. + /// + public partial class DatabaseStatistics + { + /// + /// Initializes a new instance of the DatabaseStatistics class. + /// + public DatabaseStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabaseStatistics class. + /// + /// The database size - the total size of compressed + /// data and index in bytes. + public DatabaseStatistics(double? size = default(double?)) + { + Size = size; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the database size - the total size of compressed data + /// and index in bytes. + /// + [JsonProperty(PropertyName = "size")] + public double? Size { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EngineType.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EngineType.cs new file mode 100644 index 000000000000..abe827a29654 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EngineType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for EngineType. + /// + public static class EngineType + { + public const string V2 = "V2"; + public const string V3 = "V3"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataConnection.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataConnection.cs new file mode 100644 index 000000000000..57df8f12b801 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataConnection.cs @@ -0,0 +1,180 @@ +// +// 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; + + /// + /// Class representing an Event Grid data connection. + /// + [Newtonsoft.Json.JsonObject("EventGrid")] + [Rest.Serialization.JsonTransformation] + public partial class EventGridDataConnection : DataConnection + { + /// + /// Initializes a new instance of the EventGridDataConnection class. + /// + public EventGridDataConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EventGridDataConnection class. + /// + /// The resource ID of the + /// storage account where the data resides. + /// The resource ID where the event + /// grid is configured to send events. + /// The event hub consumer group. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The table where the data should be + /// ingested. Optionally the table information can be added to each + /// message. + /// The mapping rule to be used to ingest + /// the data. Optionally the mapping information can be added to each + /// message. + /// The data format of the message. Optionally + /// the data format can be added to each message. Possible values + /// include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', + /// 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// A Boolean value that, if set to + /// true, indicates that ingestion should ignore the first record of + /// every file + /// The name of blob storage event + /// type to process. Possible values include: + /// 'Microsoft.Storage.BlobCreated', + /// 'Microsoft.Storage.BlobRenamed' + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + public EventGridDataConnection(string storageAccountResourceId, string eventHubResourceId, string consumerGroup, string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData), string tableName = default(string), string mappingRuleName = default(string), string dataFormat = default(string), bool? ignoreFirstRecord = default(bool?), string blobStorageEventType = default(string), string provisioningState = default(string)) + : base(id, name, type, location, systemData) + { + StorageAccountResourceId = storageAccountResourceId; + EventHubResourceId = eventHubResourceId; + ConsumerGroup = consumerGroup; + TableName = tableName; + MappingRuleName = mappingRuleName; + DataFormat = dataFormat; + IgnoreFirstRecord = ignoreFirstRecord; + BlobStorageEventType = blobStorageEventType; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the storage account where the data + /// resides. + /// + [JsonProperty(PropertyName = "properties.storageAccountResourceId")] + public string StorageAccountResourceId { get; set; } + + /// + /// Gets or sets the resource ID where the event grid is configured to + /// send events. + /// + [JsonProperty(PropertyName = "properties.eventHubResourceId")] + public string EventHubResourceId { get; set; } + + /// + /// Gets or sets the event hub consumer group. + /// + [JsonProperty(PropertyName = "properties.consumerGroup")] + public string ConsumerGroup { get; set; } + + /// + /// Gets or sets the table where the data should be ingested. + /// Optionally the table information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.tableName")] + public string TableName { get; set; } + + /// + /// Gets or sets the mapping rule to be used to ingest the data. + /// Optionally the mapping information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.mappingRuleName")] + public string MappingRuleName { get; set; } + + /// + /// Gets or sets the data format of the message. Optionally the data + /// format can be added to each message. Possible values include: + /// 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', + /// 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// + [JsonProperty(PropertyName = "properties.dataFormat")] + public string DataFormat { get; set; } + + /// + /// Gets or sets a Boolean value that, if set to true, indicates that + /// ingestion should ignore the first record of every file + /// + [JsonProperty(PropertyName = "properties.ignoreFirstRecord")] + public bool? IgnoreFirstRecord { get; set; } + + /// + /// Gets or sets the name of blob storage event type to process. + /// Possible values include: 'Microsoft.Storage.BlobCreated', + /// 'Microsoft.Storage.BlobRenamed' + /// + [JsonProperty(PropertyName = "properties.blobStorageEventType")] + public string BlobStorageEventType { get; set; } + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountResourceId"); + } + if (EventHubResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EventHubResourceId"); + } + if (ConsumerGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConsumerGroup"); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataFormat.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataFormat.cs new file mode 100644 index 000000000000..acf262e4a1ec --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventGridDataFormat.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for EventGridDataFormat. + /// + public static class EventGridDataFormat + { + public const string MULTIJSON = "MULTIJSON"; + public const string JSON = "JSON"; + public const string CSV = "CSV"; + public const string TSV = "TSV"; + public const string SCSV = "SCSV"; + public const string SOHSV = "SOHSV"; + public const string PSV = "PSV"; + public const string TXT = "TXT"; + public const string RAW = "RAW"; + public const string SINGLEJSON = "SINGLEJSON"; + public const string AVRO = "AVRO"; + public const string TSVE = "TSVE"; + public const string PARQUET = "PARQUET"; + public const string ORC = "ORC"; + public const string APACHEAVRO = "APACHEAVRO"; + public const string W3CLOGFILE = "W3CLOGFILE"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataConnection.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataConnection.cs new file mode 100644 index 000000000000..d05d99cd7533 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataConnection.cs @@ -0,0 +1,163 @@ +// +// 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; + + /// + /// Class representing an event hub data connection. + /// + [Newtonsoft.Json.JsonObject("EventHub")] + [Rest.Serialization.JsonTransformation] + public partial class EventHubDataConnection : DataConnection + { + /// + /// Initializes a new instance of the EventHubDataConnection class. + /// + public EventHubDataConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EventHubDataConnection class. + /// + /// The resource ID of the event hub + /// to be used to create a data connection. + /// The event hub consumer group. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The table where the data should be + /// ingested. Optionally the table information can be added to each + /// message. + /// The mapping rule to be used to ingest + /// the data. Optionally the mapping information can be added to each + /// message. + /// The data format of the message. Optionally + /// the data format can be added to each message. Possible values + /// include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', + /// 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// System properties of the event + /// hub + /// The event hub messages compression type. + /// Possible values include: 'None', 'GZip' + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + public EventHubDataConnection(string eventHubResourceId, string consumerGroup, string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData), string tableName = default(string), string mappingRuleName = default(string), string dataFormat = default(string), IList eventSystemProperties = default(IList), string compression = default(string), string provisioningState = default(string)) + : base(id, name, type, location, systemData) + { + EventHubResourceId = eventHubResourceId; + ConsumerGroup = consumerGroup; + TableName = tableName; + MappingRuleName = mappingRuleName; + DataFormat = dataFormat; + EventSystemProperties = eventSystemProperties; + Compression = compression; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the event hub to be used to create + /// a data connection. + /// + [JsonProperty(PropertyName = "properties.eventHubResourceId")] + public string EventHubResourceId { get; set; } + + /// + /// Gets or sets the event hub consumer group. + /// + [JsonProperty(PropertyName = "properties.consumerGroup")] + public string ConsumerGroup { get; set; } + + /// + /// Gets or sets the table where the data should be ingested. + /// Optionally the table information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.tableName")] + public string TableName { get; set; } + + /// + /// Gets or sets the mapping rule to be used to ingest the data. + /// Optionally the mapping information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.mappingRuleName")] + public string MappingRuleName { get; set; } + + /// + /// Gets or sets the data format of the message. Optionally the data + /// format can be added to each message. Possible values include: + /// 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', + /// 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// + [JsonProperty(PropertyName = "properties.dataFormat")] + public string DataFormat { get; set; } + + /// + /// Gets or sets system properties of the event hub + /// + [JsonProperty(PropertyName = "properties.eventSystemProperties")] + public IList EventSystemProperties { get; set; } + + /// + /// Gets or sets the event hub messages compression type. Possible + /// values include: 'None', 'GZip' + /// + [JsonProperty(PropertyName = "properties.compression")] + public string Compression { get; set; } + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (EventHubResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EventHubResourceId"); + } + if (ConsumerGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConsumerGroup"); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataFormat.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataFormat.cs new file mode 100644 index 000000000000..c997f4bb3965 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/EventHubDataFormat.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for EventHubDataFormat. + /// + public static class EventHubDataFormat + { + public const string MULTIJSON = "MULTIJSON"; + public const string JSON = "JSON"; + public const string CSV = "CSV"; + public const string TSV = "TSV"; + public const string SCSV = "SCSV"; + public const string SOHSV = "SOHSV"; + public const string PSV = "PSV"; + public const string TXT = "TXT"; + public const string RAW = "RAW"; + public const string SINGLEJSON = "SINGLEJSON"; + public const string AVRO = "AVRO"; + public const string TSVE = "TSVE"; + public const string PARQUET = "PARQUET"; + public const string ORC = "ORC"; + public const string APACHEAVRO = "APACHEAVRO"; + public const string W3CLOGFILE = "W3CLOGFILE"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataConnection.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataConnection.cs new file mode 100644 index 000000000000..097072bec45c --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataConnection.cs @@ -0,0 +1,166 @@ +// +// 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; + + /// + /// Class representing an iot hub data connection. + /// + [Newtonsoft.Json.JsonObject("IotHub")] + [Rest.Serialization.JsonTransformation] + public partial class IotHubDataConnection : DataConnection + { + /// + /// Initializes a new instance of the IotHubDataConnection class. + /// + public IotHubDataConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IotHubDataConnection class. + /// + /// The resource ID of the Iot hub to be + /// used to create a data connection. + /// The iot hub consumer group. + /// The name of the share access + /// policy + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The table where the data should be + /// ingested. Optionally the table information can be added to each + /// message. + /// The mapping rule to be used to ingest + /// the data. Optionally the mapping information can be added to each + /// message. + /// The data format of the message. Optionally + /// the data format can be added to each message. Possible values + /// include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', + /// 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// System properties of the iot + /// hub + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + public IotHubDataConnection(string iotHubResourceId, string consumerGroup, string sharedAccessPolicyName, string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData), string tableName = default(string), string mappingRuleName = default(string), string dataFormat = default(string), IList eventSystemProperties = default(IList), string provisioningState = default(string)) + : base(id, name, type, location, systemData) + { + IotHubResourceId = iotHubResourceId; + ConsumerGroup = consumerGroup; + TableName = tableName; + MappingRuleName = mappingRuleName; + DataFormat = dataFormat; + EventSystemProperties = eventSystemProperties; + SharedAccessPolicyName = sharedAccessPolicyName; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the Iot hub to be used to create a + /// data connection. + /// + [JsonProperty(PropertyName = "properties.iotHubResourceId")] + public string IotHubResourceId { get; set; } + + /// + /// Gets or sets the iot hub consumer group. + /// + [JsonProperty(PropertyName = "properties.consumerGroup")] + public string ConsumerGroup { get; set; } + + /// + /// Gets or sets the table where the data should be ingested. + /// Optionally the table information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.tableName")] + public string TableName { get; set; } + + /// + /// Gets or sets the mapping rule to be used to ingest the data. + /// Optionally the mapping information can be added to each message. + /// + [JsonProperty(PropertyName = "properties.mappingRuleName")] + public string MappingRuleName { get; set; } + + /// + /// Gets or sets the data format of the message. Optionally the data + /// format can be added to each message. Possible values include: + /// 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', + /// 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', + /// 'APACHEAVRO', 'W3CLOGFILE' + /// + [JsonProperty(PropertyName = "properties.dataFormat")] + public string DataFormat { get; set; } + + /// + /// Gets or sets system properties of the iot hub + /// + [JsonProperty(PropertyName = "properties.eventSystemProperties")] + public IList EventSystemProperties { get; set; } + + /// + /// Gets or sets the name of the share access policy + /// + [JsonProperty(PropertyName = "properties.sharedAccessPolicyName")] + public string SharedAccessPolicyName { get; set; } + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IotHubResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IotHubResourceId"); + } + if (ConsumerGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConsumerGroup"); + } + if (SharedAccessPolicyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SharedAccessPolicyName"); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataFormat.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataFormat.cs new file mode 100644 index 000000000000..6ae68ca51512 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/IotHubDataFormat.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for IotHubDataFormat. + /// + public static class IotHubDataFormat + { + public const string MULTIJSON = "MULTIJSON"; + public const string JSON = "JSON"; + public const string CSV = "CSV"; + public const string TSV = "TSV"; + public const string SCSV = "SCSV"; + public const string SOHSV = "SOHSV"; + public const string PSV = "PSV"; + public const string TXT = "TXT"; + public const string RAW = "RAW"; + public const string SINGLEJSON = "SINGLEJSON"; + public const string AVRO = "AVRO"; + public const string TSVE = "TSVE"; + public const string PARQUET = "PARQUET"; + public const string ORC = "ORC"; + public const string APACHEAVRO = "APACHEAVRO"; + public const string W3CLOGFILE = "W3CLOGFILE"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPool.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPool.cs new file mode 100644 index 000000000000..00c07692834d --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPool.cs @@ -0,0 +1,171 @@ +// +// 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; + + /// + /// Class representing a Kusto kusto pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class KustoPool : TrackedResource + { + /// + /// Initializes a new instance of the KustoPool class. + /// + public KustoPool() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KustoPool class. + /// + /// The geo-location where the resource + /// lives + /// The SKU of the kusto pool. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The state of the resource. Possible values + /// include: 'Creating', 'Unavailable', 'Running', 'Deleting', + /// 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + /// The Kusto Pool URI. + /// The Kusto Pool data ingestion + /// URI. + /// The reason for the Kusto Pool's current + /// state. + /// The engine type. Possible values include: + /// 'V2', 'V3' + /// The workspace unique identifier. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public KustoPool(string location, AzureSku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string state = default(string), string provisioningState = default(string), string uri = default(string), string dataIngestionUri = default(string), string stateReason = default(string), string engineType = default(string), string workspaceUid = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + Sku = sku; + State = state; + ProvisioningState = provisioningState; + Uri = uri; + DataIngestionUri = dataIngestionUri; + StateReason = stateReason; + EngineType = engineType; + WorkspaceUid = workspaceUid; + Etag = etag; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the SKU of the kusto pool. + /// + [JsonProperty(PropertyName = "sku")] + public AzureSku Sku { get; set; } + + /// + /// Gets the state of the resource. Possible values include: + /// 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', + /// 'Stopping', 'Stopped', 'Starting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets the Kusto Pool URI. + /// + [JsonProperty(PropertyName = "properties.uri")] + public string Uri { get; private set; } + + /// + /// Gets the Kusto Pool data ingestion URI. + /// + [JsonProperty(PropertyName = "properties.dataIngestionUri")] + public string DataIngestionUri { get; private set; } + + /// + /// Gets the reason for the Kusto Pool's current state. + /// + [JsonProperty(PropertyName = "properties.stateReason")] + public string StateReason { get; private set; } + + /// + /// Gets or sets the engine type. Possible values include: 'V2', 'V3' + /// + [JsonProperty(PropertyName = "properties.engineType")] + public string EngineType { get; set; } + + /// + /// Gets or sets the workspace unique identifier. + /// + [JsonProperty(PropertyName = "properties.workspaceUid")] + public string WorkspaceUid { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolListResult.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolListResult.cs new file mode 100644 index 000000000000..28d18177b26b --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolListResult.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list Kusto pools operation response. + /// + public partial class KustoPoolListResult + { + /// + /// Initializes a new instance of the KustoPoolListResult class. + /// + public KustoPoolListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KustoPoolListResult class. + /// + /// The list of Kusto pools. + public KustoPoolListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of Kusto pools. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolUpdate.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolUpdate.cs new file mode 100644 index 000000000000..7f6a4c82e247 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/KustoPoolUpdate.cs @@ -0,0 +1,151 @@ +// +// 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; + + /// + /// Class representing an update to a Kusto kusto pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class KustoPoolUpdate : Resource + { + /// + /// Initializes a new instance of the KustoPoolUpdate class. + /// + public KustoPoolUpdate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KustoPoolUpdate class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The SKU of the kusto pool. + /// The state of the resource. Possible values + /// include: 'Creating', 'Unavailable', 'Running', 'Deleting', + /// 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating' + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + /// The Kusto Pool URI. + /// The Kusto Pool data ingestion + /// URI. + /// The reason for the Kusto Pool's current + /// state. + /// The engine type. Possible values include: + /// 'V2', 'V3' + /// The workspace unique identifier. + public KustoPoolUpdate(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), AzureSku sku = default(AzureSku), string state = default(string), string provisioningState = default(string), string uri = default(string), string dataIngestionUri = default(string), string stateReason = default(string), string engineType = default(string), string workspaceUid = default(string)) + : base(id, name, type) + { + Tags = tags; + Sku = sku; + State = state; + ProvisioningState = provisioningState; + Uri = uri; + DataIngestionUri = dataIngestionUri; + StateReason = stateReason; + EngineType = engineType; + WorkspaceUid = workspaceUid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the SKU of the kusto pool. + /// + [JsonProperty(PropertyName = "sku")] + public AzureSku Sku { get; set; } + + /// + /// Gets the state of the resource. Possible values include: + /// 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', + /// 'Stopping', 'Stopped', 'Starting', 'Updating' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets the Kusto Pool URI. + /// + [JsonProperty(PropertyName = "properties.uri")] + public string Uri { get; private set; } + + /// + /// Gets the Kusto Pool data ingestion URI. + /// + [JsonProperty(PropertyName = "properties.dataIngestionUri")] + public string DataIngestionUri { get; private set; } + + /// + /// Gets the reason for the Kusto Pool's current state. + /// + [JsonProperty(PropertyName = "properties.stateReason")] + public string StateReason { get; private set; } + + /// + /// Gets or sets the engine type. Possible values include: 'V2', 'V3' + /// + [JsonProperty(PropertyName = "properties.engineType")] + public string EngineType { get; set; } + + /// + /// Gets or sets the workspace unique identifier. + /// + [JsonProperty(PropertyName = "properties.workspaceUid")] + public string WorkspaceUid { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Operation.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Operation.cs new file mode 100644 index 000000000000..4448e621d1eb --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/Operation.cs @@ -0,0 +1,80 @@ +// +// 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; + + /// + /// A REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// The operation name. + /// The object that describes the + /// operation. + /// The intended executor of the + /// operation. + /// Properties of the operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string), object properties = default(object)) + { + Name = name; + Display = display; + Origin = origin; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the operation name. + /// + /// + /// This is of the format {provider}/{resource}/{operation}. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the object that describes the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + /// + /// Gets or sets the intended executor of the operation. + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// Gets or sets properties of the operation. + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationDisplay.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..82b872629867 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,81 @@ +// +// 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; + + /// + /// The object that describes the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Friendly name of the resource + /// provider. + /// The operation type. + /// The resource type on which the operation is + /// performed. + /// The friendly name of the + /// operation. + public OperationDisplay(string provider = default(string), string operation = default(string), string resource = default(string), string description = default(string)) + { + Provider = provider; + Operation = operation; + Resource = resource; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets friendly name of the resource provider. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the operation type. + /// + /// + /// For example: read, write, delete. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets the resource type on which the operation is performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets the friendly name of the operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ReadWriteDatabase.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ReadWriteDatabase.cs new file mode 100644 index 000000000000..2007e8d78dd5 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ReadWriteDatabase.cs @@ -0,0 +1,106 @@ +// +// 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; + + /// + /// Class representing a read write database. + /// + [Newtonsoft.Json.JsonObject("ReadWrite")] + [Rest.Serialization.JsonTransformation] + public partial class ReadWriteDatabase : Database + { + /// + /// Initializes a new instance of the ReadWriteDatabase class. + /// + public ReadWriteDatabase() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReadWriteDatabase class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource location. + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The provisioned state of the + /// resource. Possible values include: 'Running', 'Creating', + /// 'Deleting', 'Succeeded', 'Failed', 'Moving', 'Canceled' + /// The time the data should be kept + /// before it stops being accessible to queries in TimeSpan. + /// The time the data should be kept in + /// cache for fast queries in TimeSpan. + /// The statistics of the database. + /// Indicates whether the database is + /// followed. + public ReadWriteDatabase(string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), System.TimeSpan? softDeletePeriod = default(System.TimeSpan?), System.TimeSpan? hotCachePeriod = default(System.TimeSpan?), DatabaseStatistics statistics = default(DatabaseStatistics), bool? isFollowed = default(bool?)) + : base(id, name, type, location, systemData) + { + ProvisioningState = provisioningState; + SoftDeletePeriod = softDeletePeriod; + HotCachePeriod = hotCachePeriod; + Statistics = statistics; + IsFollowed = isFollowed; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the provisioned state of the resource. Possible values + /// include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Moving', 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the time the data should be kept before it stops being + /// accessible to queries in TimeSpan. + /// + [JsonProperty(PropertyName = "properties.softDeletePeriod")] + public System.TimeSpan? SoftDeletePeriod { get; set; } + + /// + /// Gets or sets the time the data should be kept in cache for fast + /// queries in TimeSpan. + /// + [JsonProperty(PropertyName = "properties.hotCachePeriod")] + public System.TimeSpan? HotCachePeriod { get; set; } + + /// + /// Gets or sets the statistics of the database. + /// + [JsonProperty(PropertyName = "properties.statistics")] + public DatabaseStatistics Statistics { get; set; } + + /// + /// Gets indicates whether the database is followed. + /// + [JsonProperty(PropertyName = "properties.isFollowed")] + public bool? IsFollowed { get; private set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ResourceProvisioningState.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ResourceProvisioningState.cs new file mode 100644 index 000000000000..d24b644bf0ac --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/ResourceProvisioningState.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for ResourceProvisioningState. + /// + public static class ResourceProvisioningState + { + public const string Running = "Running"; + public const string Creating = "Creating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Moving = "Moving"; + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/State.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/State.cs new file mode 100644 index 000000000000..6cc036101362 --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/State.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Synapse.Models +{ + + /// + /// Defines values for State. + /// + public static class State + { + public const string Creating = "Creating"; + public const string Unavailable = "Unavailable"; + public const string Running = "Running"; + public const string Deleting = "Deleting"; + public const string Deleted = "Deleted"; + public const string Stopping = "Stopping"; + public const string Stopped = "Stopped"; + public const string Starting = "Starting"; + public const string Updating = "Updating"; + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..8066d833b1ad --- /dev/null +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs index 67386f60459d..111e28ff999c 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperations.cs @@ -270,6 +270,235 @@ internal PrivateEndpointConnectionsPrivateLinkHubOperations(SynapseManagementCli return _result; } + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (privateLinkHubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateLinkHubName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("privateLinkHubName", privateLinkHubName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{privateLinkHubName}", System.Uri.EscapeDataString(privateLinkHubName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs index 8551af5d0e49..1340c0e2c0ae 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/PrivateEndpointConnectionsPrivateLinkHubOperationsExtensions.cs @@ -61,6 +61,52 @@ public static IPage List(this IPriva } } + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + public static PrivateEndpointConnectionForPrivateLinkHub Get(this IPrivateEndpointConnectionsPrivateLinkHubOperations operations, string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get all PrivateEndpointConnection in the PrivateLinkHub by name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the privateLinkHub + /// + /// + /// Name of the privateEndpointConnection + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsPrivateLinkHubOperations operations, string resourceGroupName, string privateLinkHubName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, privateLinkHubName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get all PrivateEndpointConnections in the PrivateLinkHub /// diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs index 0bd4431f3892..d72d8a0fea05 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SdkInfo_SynapseManagementClient.cs @@ -19,80 +19,74 @@ public static IEnumerable> ApiInfo_SynapseManageme { return new Tuple[] { - new Tuple("Synapse", "BigDataPools", "2021-03-01"), - new Tuple("Synapse", "DataMaskingPolicies", "2021-03-01"), - new Tuple("Synapse", "DataMaskingRules", "2021-03-01"), - new Tuple("Synapse", "ExtendedSqlPoolBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeAuthKeys", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeConnectionInfos", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeCredentials", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeMonitoringData", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeNodeIpAddress", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeNodes", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeObjectMetadata", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimeStatus", "2021-03-01"), - new Tuple("Synapse", "IntegrationRuntimes", "2021-03-01"), - new Tuple("Synapse", "IpFirewallRules", "2021-03-01"), - new Tuple("Synapse", "Keys", "2021-03-01"), - new Tuple("Synapse", "Libraries", "2021-03-01"), - new Tuple("Synapse", "Library", "2021-03-01"), - new Tuple("Synapse", "Operations", "2021-03-01"), - new Tuple("Synapse", "PrivateEndpointConnections", "2021-03-01"), - new Tuple("Synapse", "PrivateEndpointConnectionsPrivateLinkHub", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkHubPrivateLinkResources", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkHubs", "2021-03-01"), - new Tuple("Synapse", "PrivateLinkResources", "2021-03-01"), - new Tuple("Synapse", "RestorableDroppedSqlPools", "2021-03-01"), - new Tuple("Synapse", "SqlPoolBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolColumns", "2021-03-01"), - new Tuple("Synapse", "SqlPoolConnectionPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolDataWarehouseUserActivities", "2021-03-01"), - new Tuple("Synapse", "SqlPoolGeoBackupPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMaintenanceWindowOptions", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMaintenanceWindows", "2021-03-01"), - new Tuple("Synapse", "SqlPoolMetadataSyncConfigs", "2021-03-01"), - new Tuple("Synapse", "SqlPoolOperationResults", "2021-03-01"), - new Tuple("Synapse", "SqlPoolOperations", "2021-03-01"), - new Tuple("Synapse", "SqlPoolRecommendedSensitivityLabels", "2021-03-01"), - new Tuple("Synapse", "SqlPoolReplicationLinks", "2021-03-01"), - new Tuple("Synapse", "SqlPoolRestorePoints", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSchemas", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSecurityAlertPolicies", "2021-03-01"), - new Tuple("Synapse", "SqlPoolSensitivityLabels", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTableColumns", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTables", "2021-03-01"), - new Tuple("Synapse", "SqlPoolTransparentDataEncryptions", "2021-03-01"), - new Tuple("Synapse", "SqlPoolUsages", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentRuleBaselines", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentScans", "2021-03-01"), - new Tuple("Synapse", "SqlPoolVulnerabilityAssessments", "2021-03-01"), - new Tuple("Synapse", "SqlPoolWorkloadClassifier", "2021-03-01"), - new Tuple("Synapse", "SqlPoolWorkloadGroup", "2021-03-01"), - new Tuple("Synapse", "SqlPools", "2021-03-01"), - new Tuple("Synapse", "WorkspaceAadAdmins", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedIdentitySqlControlSettings", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerEncryptionProtector", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerExtendedBlobAuditingPolicies", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerRecoverableSqlPools", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerSecurityAlertPolicy", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerUsages", "2021-03-01"), - new Tuple("Synapse", "WorkspaceManagedSqlServerVulnerabilityAssessments", "2021-03-01"), - new Tuple("Synapse", "WorkspaceSqlAadAdmins", "2021-03-01"), - new Tuple("Synapse", "Workspaces", "2021-03-01"), + new Tuple("Synapse", "BigDataPools", "2021-04-01-preview"), + new Tuple("Synapse", "DataConnections", "2021-04-01-preview"), + new Tuple("Synapse", "DataMaskingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "DataMaskingRules", "2021-04-01-preview"), + new Tuple("Synapse", "Databases", "2021-04-01-preview"), + new Tuple("Synapse", "ExtendedSqlPoolBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeAuthKeys", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeConnectionInfos", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeCredentials", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeMonitoringData", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeNodeIpAddress", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeNodes", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeObjectMetadata", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimeStatus", "2021-04-01-preview"), + new Tuple("Synapse", "IntegrationRuntimes", "2021-04-01-preview"), + new Tuple("Synapse", "IpFirewallRules", "2021-04-01-preview"), + new Tuple("Synapse", "Keys", "2021-04-01-preview"), + new Tuple("Synapse", "KustoOperations", "2021-04-01-preview"), + new Tuple("Synapse", "KustoPools", "2021-04-01-preview"), + new Tuple("Synapse", "Libraries", "2021-04-01-preview"), + new Tuple("Synapse", "Library", "2021-04-01-preview"), + new Tuple("Synapse", "Operations", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateEndpointConnections", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateEndpointConnectionsPrivateLinkHub", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkHubPrivateLinkResources", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkHubs", "2021-04-01-preview"), + new Tuple("Synapse", "PrivateLinkResources", "2021-04-01-preview"), + new Tuple("Synapse", "RestorableDroppedSqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolColumns", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolConnectionPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolDataWarehouseUserActivities", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolGeoBackupPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMaintenanceWindowOptions", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMaintenanceWindows", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolMetadataSyncConfigs", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolOperationResults", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolOperations", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolRecommendedSensitivityLabels", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolReplicationLinks", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolRestorePoints", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSchemas", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSecurityAlertPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolSensitivityLabels", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTableColumns", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTables", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolTransparentDataEncryptions", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolUsages", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentRuleBaselines", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessmentScans", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolVulnerabilityAssessments", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolWorkloadClassifier", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPoolWorkloadGroup", "2021-04-01-preview"), + new Tuple("Synapse", "SqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceAadAdmins", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedIdentitySqlControlSettings", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerEncryptionProtector", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerExtendedBlobAuditingPolicies", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerRecoverableSqlPools", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerSecurityAlertPolicy", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerUsages", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceManagedSqlServerVulnerabilityAssessments", "2021-04-01-preview"), + new Tuple("Synapse", "WorkspaceSqlAadAdmins", "2021-04-01-preview"), + new Tuple("Synapse", "Workspaces", "2021-04-01-preview"), + new Tuple("Synapse", "kustoPools", "2021-04-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/synapse/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\code\\AzureSDK\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "169c6171bad2f782dc1cd5f23bcb803ce7649b0b"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs index c835dba8e00e..7cfd53998e20 100644 --- a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs +++ b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/SynapseManagementClient.cs @@ -139,6 +139,26 @@ public partial class SynapseManagementClient : ServiceClient public virtual IKeysOperations Keys { get; private set; } + /// + /// Gets the IKustoOperations. + /// + public virtual IKustoOperations KustoOperations { get; private set; } + + /// + /// Gets the IKustoPoolsOperations. + /// + public virtual IKustoPoolsOperations KustoPools { get; private set; } + + /// + /// Gets the IDatabasesOperations. + /// + public virtual IDatabasesOperations Databases { get; private set; } + + /// + /// Gets the IDataConnectionsOperations. + /// + public virtual IDataConnectionsOperations DataConnections { get; private set; } + /// /// Gets the ILibraryOperations. /// @@ -633,6 +653,10 @@ private void Initialize() IntegrationRuntimeMonitoringData = new IntegrationRuntimeMonitoringDataOperations(this); IntegrationRuntimeStatus = new IntegrationRuntimeStatusOperations(this); Keys = new KeysOperations(this); + KustoOperations = new KustoOperations(this); + KustoPools = new KustoPoolsOperations(this); + Databases = new DatabasesOperations(this); + DataConnections = new DataConnectionsOperations(this); Library = new LibraryOperations(this); Libraries = new LibrariesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); @@ -682,7 +706,7 @@ private void Initialize() WorkspaceManagedIdentitySqlControlSettings = new WorkspaceManagedIdentitySqlControlSettingsOperations(this); RestorableDroppedSqlPools = new RestorableDroppedSqlPoolsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-03-01"; + ApiVersion = "2021-04-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -724,6 +748,10 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs similarity index 100% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperations.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperations.cs diff --git a/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperationsExtensions.cs b/sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperationsExtensions.cs similarity index 100% rename from sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlpoolsOperationsExtensions.cs rename to sdk/synapse/Microsoft.Azure.Management.Synapse/src/Generated/WorkspaceManagedSqlServerRecoverableSqlPoolsOperationsExtensions.cs