diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperations.cs deleted file mode 100644 index b43e5854018f..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperations.cs +++ /dev/null @@ -1,2159 +0,0 @@ -// -// 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.StreamAnalytics -{ - 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; - - /// - /// ClustersOperations operations. - /// - internal partial class ClustersOperations : IServiceOperations, IClustersOperations - { - /// - /// Initializes a new instance of the ClustersOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ClustersOperations(StreamAnalyticsManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the StreamAnalyticsManagementClient - /// - public StreamAnalyticsManagementClient Client { get; private set; } - - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, ifNoneMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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 clusterName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// 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>> ListBySubscriptionWithHttpMessagesAsync(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); - } - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/clusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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 all of the clusters in the given resource group. - /// - /// - /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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\\._\\(\\)]+$"); - } - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.StreamAnalytics/clusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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 all of the streaming jobs in the given cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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>> ListStreamingJobsWithHttpMessagesAsync(string resourceGroupName, string clusterName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListStreamingJobs", 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.StreamAnalytics/clusters/{clusterName}/listStreamingJobs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (cluster == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cluster"); - } - if (cluster != null) - { - cluster.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 (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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("cluster", cluster); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(cluster != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(cluster, 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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 an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (cluster == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "cluster"); - } - 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("cluster", cluster); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(cluster != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(cluster, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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 clusterName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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 all of the clusters in the given resource group. - /// - /// - /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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 all of the streaming jobs in the given cluster. - /// - /// - /// 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>> ListStreamingJobsNextWithHttpMessagesAsync(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, "ListStreamingJobsNext", 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperationsExtensions.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperationsExtensions.cs deleted file mode 100644 index 603689355063..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ClustersOperationsExtensions.cs +++ /dev/null @@ -1,603 +0,0 @@ -// -// 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.StreamAnalytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ClustersOperations. - /// - public static partial class ClustersOperationsExtensions - { - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - public static Cluster CreateOrUpdate(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.CreateOrUpdateAsync(cluster, resourceGroupName, clusterName, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - public static Cluster Update(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string)) - { - return operations.UpdateAsync(cluster, resourceGroupName, clusterName, ifMatch).GetAwaiter().GetResult(); - } - - /// - /// Updates an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string clusterName) - { - return operations.GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - public static void Delete(this IClustersOperations operations, string resourceGroupName, string clusterName) - { - operations.DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IClustersOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IClustersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IClustersOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IClustersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - public static IPage ListStreamingJobs(this IClustersOperations operations, string resourceGroupName, string clusterName) - { - return operations.ListStreamingJobsAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The cancellation token. - /// - public static async Task> ListStreamingJobsAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStreamingJobsWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.BeginCreateOrUpdateAsync(cluster, resourceGroupName, clusterName, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Creates a Stream Analytics Cluster or replaces an already existing cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the cluster that will be used to create a new cluster or - /// replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - public static Cluster BeginUpdate(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string)) - { - return operations.BeginUpdateAsync(cluster, resourceGroupName, clusterName, ifMatch).GetAwaiter().GetResult(); - } - - /// - /// Updates an existing cluster. This can be used to partially update (ie. - /// update one or two properties) a cluster without affecting the rest of the - /// cluster definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The properties specified here will overwrite the corresponding properties - /// in the existing cluster (ie. Those properties will be updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IClustersOperations operations, Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(cluster, resourceGroupName, clusterName, ifMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string clusterName) - { - operations.BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IClustersOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IClustersOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListStreamingJobsNext(this IClustersOperations operations, string nextPageLink) - { - return operations.ListStreamingJobsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListStreamingJobsNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListStreamingJobsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs index c94f1fdc45bd..6b8fbda87198 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs @@ -104,6 +104,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "function"); } + 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"); @@ -142,7 +153,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153,7 +163,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) tracingParameters.Add("function", function); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -168,9 +177,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -403,6 +412,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "function"); } + 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"); @@ -441,7 +461,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -451,7 +470,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("function", function); tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -466,9 +484,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -654,6 +672,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobName, string functionName, 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"); @@ -692,7 +721,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -700,7 +728,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -715,9 +742,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -861,6 +888,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobName, string functionName, 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"); @@ -899,7 +937,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -907,7 +944,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -922,9 +958,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1102,6 +1138,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// public async Task>> ListByStreamingJobWithHttpMessagesAsync(string resourceGroupName, string jobName, string select = default(string), 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"); @@ -1136,7 +1183,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1145,7 +1191,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("select", select); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1162,9 +1207,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1367,6 +1412,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// public async Task> RetrieveDefaultDefinitionWithHttpMessagesAsync(string resourceGroupName, string jobName, string functionName, FunctionRetrieveDefaultDefinitionParameters functionRetrieveDefaultDefinitionParameters = default(FunctionRetrieveDefaultDefinitionParameters), 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"); @@ -1405,7 +1461,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1414,7 +1469,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("functionRetrieveDefaultDefinitionParameters", functionRetrieveDefaultDefinitionParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -1429,9 +1483,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1610,6 +1664,17 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// public async Task> BeginTestWithHttpMessagesAsync(string resourceGroupName, string jobName, string functionName, Function function = default(Function), 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"); @@ -1648,7 +1713,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "functionName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1657,7 +1721,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("function", function); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("functionName", functionName); @@ -1672,9 +1735,9 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{functionName}", System.Uri.EscapeDataString(functionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IClustersOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IClustersOperations.cs deleted file mode 100644 index b1933f366933..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IClustersOperations.cs +++ /dev/null @@ -1,382 +0,0 @@ -// -// 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.StreamAnalytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// ClustersOperations operations. - /// - public partial interface IClustersOperations - { - /// - /// Creates a Stream Analytics Cluster or replaces an already existing - /// cluster. - /// - /// - /// The definition of the cluster that will be used to create a new - /// cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the - /// current record set. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent - /// updating an existing record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates an existing cluster. This can be used to partially update - /// (ie. update one or two properties) a cluster without affecting the - /// rest of the cluster definition. - /// - /// - /// The properties specified here will overwrite the corresponding - /// properties in the existing cluster (ie. Those properties will be - /// updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the - /// current record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets information about the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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>> ListStreamingJobsWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a Stream Analytics Cluster or replaces an already existing - /// cluster. - /// - /// - /// The definition of the cluster that will be used to create a new - /// cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the - /// current record set. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent - /// updating an existing record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates an existing cluster. This can be used to partially update - /// (ie. update one or two properties) a cluster without affecting the - /// rest of the cluster definition. - /// - /// - /// The properties specified here will overwrite the corresponding - /// properties in the existing cluster (ie. Those properties will be - /// updated). - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the - /// current record set. 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(Cluster cluster, string resourceGroupName, string clusterName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the clusters in the given subscription. - /// - /// - /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the clusters in the given resource group. - /// - /// - /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the streaming jobs in the given cluster. - /// - /// - /// 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>> ListStreamingJobsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IPrivateEndpointsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IPrivateEndpointsOperations.cs deleted file mode 100644 index 65bb421f77bf..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IPrivateEndpointsOperations.cs +++ /dev/null @@ -1,195 +0,0 @@ -// -// 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.StreamAnalytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PrivateEndpointsOperations operations. - /// - public partial interface IPrivateEndpointsOperations - { - /// - /// Creates a Stream Analytics Private Endpoint or replaces an already - /// existing Private Endpoint. - /// - /// - /// The definition of the private endpoint that will be used to create - /// a new cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the - /// current record set. Specify the last-seen ETag value to prevent - /// accidentally overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent - /// updating an existing record set. 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(PrivateEndpoint privateEndpoint, string resourceGroupName, string clusterName, string privateEndpointName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets information about the specified Private Endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// 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 clusterName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the specified private endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// 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 clusterName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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>> ListByClusterWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the specified private endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// 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 clusterName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// 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>> ListByClusterNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamAnalyticsManagementClient.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamAnalyticsManagementClient.cs index a2f00f15315f..149663b10ec4 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamAnalyticsManagementClient.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamAnalyticsManagementClient.cs @@ -45,6 +45,11 @@ public partial interface IStreamAnalyticsManagementClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + /// /// The preferred language for the response. /// @@ -74,6 +79,11 @@ public partial interface IStreamAnalyticsManagementClient : System.IDisposable /// IInputsOperations Inputs { get; } + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + /// /// Gets the IOutputsOperations. /// @@ -94,20 +104,5 @@ public partial interface IStreamAnalyticsManagementClient : System.IDisposable /// ITransformationsOperations Transformations { get; } - /// - /// Gets the IOperations. - /// - IOperations Operations { get; } - - /// - /// Gets the IClustersOperations. - /// - IClustersOperations Clusters { get; } - - /// - /// Gets the IPrivateEndpointsOperations. - /// - IPrivateEndpointsOperations PrivateEndpoints { get; } - } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs index c2f98caabf86..bbe6ff8830ed 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs @@ -108,6 +108,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { input.Validate(); } + 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"); @@ -146,7 +157,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -157,7 +167,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) tracingParameters.Add("input", input); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("inputName", inputName); @@ -172,9 +181,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{inputName}", System.Uri.EscapeDataString(inputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -407,6 +416,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "input"); } + 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"); @@ -445,7 +465,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -455,7 +474,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("input", input); tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("inputName", inputName); @@ -470,9 +488,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{inputName}", System.Uri.EscapeDataString(inputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -658,6 +676,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobName, string inputName, 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"); @@ -696,7 +725,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,7 +732,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("inputName", inputName); @@ -719,9 +746,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{inputName}", System.Uri.EscapeDataString(inputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -865,6 +892,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobName, string inputName, 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"); @@ -903,7 +941,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,7 +948,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("inputName", inputName); @@ -926,9 +962,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{inputName}", System.Uri.EscapeDataString(inputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1106,6 +1142,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// public async Task>> ListByStreamingJobWithHttpMessagesAsync(string resourceGroupName, string jobName, string select = default(string), 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"); @@ -1140,7 +1187,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1149,7 +1195,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("select", select); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1166,9 +1211,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1377,6 +1422,17 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { input.Validate(); } + 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"); @@ -1415,7 +1471,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1424,7 +1479,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("input", input); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("inputName", inputName); @@ -1439,9 +1493,9 @@ internal InputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{inputName}", System.Uri.EscapeDataString(inputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Cluster.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Cluster.cs deleted file mode 100644 index bd2976be2e5c..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Cluster.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Stream Analytics Cluster object - /// - public partial class Cluster : TrackedResource - { - /// - /// Initializes a new instance of the Cluster class. - /// - public Cluster() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Cluster 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// Resource tags. - /// The geo-location where the resource - /// lives - /// The current entity tag for the cluster. This is - /// an opaque string. You can use it to detect whether the resource has - /// changed between requests. You can also use it in the If-Match or - /// If-None-Match headers for write operations for optimistic - /// concurrency. - /// The properties associated with a Stream - /// Analytics cluster. - public Cluster(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), ClusterSku sku = default(ClusterSku), string etag = default(string), ClusterProperties properties = default(ClusterProperties)) - : base(id, name, type, tags, location) - { - Sku = sku; - Etag = etag; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "sku")] - public ClusterSku Sku { get; set; } - - /// - /// Gets the current entity tag for the cluster. This is an opaque - /// string. You can use it to detect whether the resource has changed - /// between requests. You can also use it in the If-Match or - /// If-None-Match headers for write operations for optimistic - /// concurrency. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets or sets the properties associated with a Stream Analytics - /// cluster. - /// - [JsonProperty(PropertyName = "properties")] - public ClusterProperties Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Sku != null) - { - Sku.Validate(); - } - } - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterJob.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterJob.cs deleted file mode 100644 index ebe97a6f4fb6..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterJob.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A streaming job. - /// - public partial class ClusterJob - { - /// - /// Initializes a new instance of the ClusterJob class. - /// - public ClusterJob() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ClusterJob class. - /// - /// Resource ID of the streaming job. - /// The number of streaming units that are - /// used by the streaming job. - /// Possible values include: 'Created', - /// 'Starting', 'Running', 'Stopping', 'Stopped', 'Deleting', 'Failed', - /// 'Degraded', 'Restarting', 'Scaling' - public ClusterJob(string id = default(string), int? streamingUnits = default(int?), string jobState = default(string)) - { - Id = id; - StreamingUnits = streamingUnits; - JobState = jobState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource ID of the streaming job. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the number of streaming units that are used by the streaming - /// job. - /// - [JsonProperty(PropertyName = "streamingUnits")] - public int? StreamingUnits { get; private set; } - - /// - /// Gets or sets possible values include: 'Created', 'Starting', - /// 'Running', 'Stopping', 'Stopped', 'Deleting', 'Failed', 'Degraded', - /// 'Restarting', 'Scaling' - /// - [JsonProperty(PropertyName = "jobState")] - public string JobState { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProperties.cs deleted file mode 100644 index d8f8a282f599..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProperties.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties associated with a Stream Analytics cluster. - /// - public partial class ClusterProperties - { - /// - /// Initializes a new instance of the ClusterProperties class. - /// - public ClusterProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ClusterProperties class. - /// - /// The date this cluster was - /// created. - /// Unique identifier for the cluster. - /// Possible values include: - /// 'Succeeded', 'Failed', 'Canceled', 'InProgress' - /// Represents the number of streaming - /// units currently being used on the cluster. - /// Represents the sum of the SUs of all - /// streaming jobs associated with the cluster. If all of the jobs were - /// running, this would be the capacity allocated. - public ClusterProperties(System.DateTime? createdDate = default(System.DateTime?), string clusterId = default(string), string provisioningState = default(string), int? capacityAllocated = default(int?), int? capacityAssigned = default(int?)) - { - CreatedDate = createdDate; - ClusterId = clusterId; - ProvisioningState = provisioningState; - CapacityAllocated = capacityAllocated; - CapacityAssigned = capacityAssigned; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the date this cluster was created. - /// - [JsonProperty(PropertyName = "createdDate")] - public System.DateTime? CreatedDate { get; private set; } - - /// - /// Gets unique identifier for the cluster. - /// - [JsonProperty(PropertyName = "clusterId")] - public string ClusterId { get; private set; } - - /// - /// Gets or sets possible values include: 'Succeeded', 'Failed', - /// 'Canceled', 'InProgress' - /// - [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; set; } - - /// - /// Gets represents the number of streaming units currently being used - /// on the cluster. - /// - [JsonProperty(PropertyName = "capacityAllocated")] - public int? CapacityAllocated { get; private set; } - - /// - /// Gets represents the sum of the SUs of all streaming jobs associated - /// with the cluster. If all of the jobs were running, this would be - /// the capacity allocated. - /// - [JsonProperty(PropertyName = "capacityAssigned")] - public int? CapacityAssigned { get; private set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProvisioningState.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProvisioningState.cs deleted file mode 100644 index 8d4c60125ad5..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterProvisioningState.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - - /// - /// Defines values for ClusterProvisioningState. - /// - public static class ClusterProvisioningState - { - /// - /// The cluster provisioning succeeded. - /// - public const string Succeeded = "Succeeded"; - /// - /// The cluster provisioning failed. - /// - public const string Failed = "Failed"; - /// - /// The cluster provisioning was canceled. - /// - public const string Canceled = "Canceled"; - /// - /// The cluster provisioning was inprogress. - /// - public const string InProgress = "InProgress"; - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSku.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSku.cs deleted file mode 100644 index f4243fd39f10..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSku.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The SKU of the cluster. This determines the size/capacity of the - /// cluster. Required on PUT (CreateOrUpdate) requests. - /// - public partial class ClusterSku - { - /// - /// Initializes a new instance of the ClusterSku class. - /// - public ClusterSku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ClusterSku class. - /// - /// Specifies the SKU name of the cluster. Required - /// on PUT (CreateOrUpdate) requests. Possible values include: - /// 'Default' - /// Denotes the number of streaming units the - /// cluster can support. Valid values for this property are multiples - /// of 36 with a minimum value of 36 and maximum value of 216. Required - /// on PUT (CreateOrUpdate) requests. - public ClusterSku(string name = default(string), int? capacity = default(int?)) - { - Name = name; - Capacity = capacity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets specifies the SKU name of the cluster. Required on PUT - /// (CreateOrUpdate) requests. Possible values include: 'Default' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets denotes the number of streaming units the cluster can - /// support. Valid values for this property are multiples of 36 with a - /// minimum value of 36 and maximum value of 216. Required on PUT - /// (CreateOrUpdate) requests. - /// - [JsonProperty(PropertyName = "capacity")] - public int? Capacity { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Capacity > 216) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Capacity", 216); - } - if (Capacity < 36) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 36); - } - } - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs deleted file mode 100644 index 3137e47292f3..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - - /// - /// Defines values for ClusterSkuName. - /// - public static class ClusterSkuName - { - /// - /// The default SKU. - /// - public const string Default = "Default"; - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Error.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Error.cs deleted file mode 100644 index 10622d367f28..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Error.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Common error representation. - /// - public partial class Error - { - /// - /// Initializes a new instance of the Error class. - /// - public Error() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Error class. - /// - /// Error definition properties. - public Error(ErrorError errorProperty = default(ErrorError)) - { - ErrorProperty = errorProperty; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets error definition properties. - /// - [JsonProperty(PropertyName = "error")] - public ErrorError ErrorProperty { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorDetails.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorDetails.cs deleted file mode 100644 index 7a403197eafb..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorDetails.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Common error details representation. - /// - public partial class ErrorDetails - { - /// - /// Initializes a new instance of the ErrorDetails class. - /// - public ErrorDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorDetails class. - /// - /// Error code. - /// Error target. - /// Error message. - public ErrorDetails(string code = default(string), string target = default(string), string message = default(string)) - { - Code = code; - Target = target; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorError.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorError.cs deleted file mode 100644 index 646bdfe00075..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorError.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Error definition properties. - /// - public partial class ErrorError - { - /// - /// Initializes a new instance of the ErrorError class. - /// - public ErrorError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorError class. - /// - /// Error code. - /// Error message. - /// Error target. - /// Error details. - public ErrorError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) - { - Code = code; - Message = message; - Target = target; - Details = details; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorException.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorException.cs deleted file mode 100644 index 1447cc601969..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ErrorException.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Microsoft.Rest; - - /// - /// Exception thrown for an invalid response with Error information. - /// - public partial class ErrorException : RestException - { - /// - /// Gets information about the associated HTTP request. - /// - public HttpRequestMessageWrapper Request { get; set; } - - /// - /// Gets information about the associated HTTP response. - /// - public HttpResponseMessageWrapper Response { get; set; } - - /// - /// Gets or sets the body object. - /// - public Error Body { get; set; } - - /// - /// Initializes a new instance of the ErrorException class. - /// - public ErrorException() - { - } - - /// - /// Initializes a new instance of the ErrorException class. - /// - /// The exception message. - public ErrorException(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the ErrorException class. - /// - /// The exception message. - /// Inner exception. - public ErrorException(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs index fd6097c6bbbe..6fa105b54ec5 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// The physical binding of the function. For example, in the Azure Machine /// Learning web service’s case, this describes the endpoint. /// - [Newtonsoft.Json.JsonObject("FunctionBinding")] public partial class FunctionBinding { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs index cc6cf33a721c..c7b7748e0c35 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The properties that are associated with a function. /// - [Newtonsoft.Json.JsonObject("FunctionProperties")] [Rest.Serialization.JsonTransformation] public partial class FunctionProperties { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs index 093b04588198..30923e68a81c 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Parameters used to specify the type of function to retrieve the default /// definition for. /// - [Newtonsoft.Json.JsonObject("FunctionRetrieveDefaultDefinitionParameters")] public partial class FunctionRetrieveDefaultDefinitionParameters { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs index fd618c6effe8..747958f68cb3 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The properties that are associated with an input. /// - [Newtonsoft.Json.JsonObject("InputProperties")] public partial class InputProperties { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/JobState.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/JobState.cs deleted file mode 100644 index 8c1c9f10c38d..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/JobState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - - /// - /// Defines values for JobState. - /// - public static class JobState - { - /// - /// The job is currently in the Created state. - /// - public const string Created = "Created"; - /// - /// The job is currently in the Starting state. - /// - public const string Starting = "Starting"; - /// - /// The job is currently in the Running state. - /// - public const string Running = "Running"; - /// - /// The job is currently in the Stopping state. - /// - public const string Stopping = "Stopping"; - /// - /// The job is currently in the Stopped state. - /// - public const string Stopped = "Stopped"; - /// - /// The job is currently in the Deleting state. - /// - public const string Deleting = "Deleting"; - /// - /// The job is currently in the Failed state. - /// - public const string Failed = "Failed"; - /// - /// The job is currently in the Degraded state. - /// - public const string Degraded = "Degraded"; - /// - /// The job is currently in the Restarting state. - /// - public const string Restarting = "Restarting"; - /// - /// The job is currently in the Scaling state. - /// - public const string Scaling = "Scaling"; - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs index 4a075fdc0034..f43854f245b8 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes the data source that output will be written to. /// - [Newtonsoft.Json.JsonObject("OutputDataSource")] public partial class OutputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpoint.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpoint.cs deleted file mode 100644 index fa7303d10964..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpoint.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Complete information about the private endpoint. - /// - public partial class PrivateEndpoint : ProxyResource - { - /// - /// Initializes a new instance of the PrivateEndpoint class. - /// - public PrivateEndpoint() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateEndpoint 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// The properties associated with a private - /// endpoint. - /// Unique opaque string (generally a GUID) that - /// represents the metadata state of the resource (private endpoint) - /// and changes whenever the resource is updated. Required on PUT - /// (CreateOrUpdate) requests. - public PrivateEndpoint(string id = default(string), string name = default(string), string type = default(string), PrivateEndpointProperties properties = default(PrivateEndpointProperties), string etag = default(string)) - : base(id, name, type) - { - Properties = properties; - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the properties associated with a private endpoint. - /// - [JsonProperty(PropertyName = "properties")] - public PrivateEndpointProperties Properties { get; set; } - - /// - /// Gets unique opaque string (generally a GUID) that represents the - /// metadata state of the resource (private endpoint) and changes - /// whenever the resource is updated. Required on PUT (CreateOrUpdate) - /// requests. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpointProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpointProperties.cs deleted file mode 100644 index ac3c56c8aae6..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateEndpointProperties.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties associated with a private endpoint. - /// - public partial class PrivateEndpointProperties - { - /// - /// Initializes a new instance of the PrivateEndpointProperties class. - /// - public PrivateEndpointProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateEndpointProperties class. - /// - /// The date when this private endpoint was - /// created. - /// A list of - /// connections to the remote resource. Immutable after it is - /// set. - public PrivateEndpointProperties(string createdDate = default(string), IList manualPrivateLinkServiceConnections = default(IList)) - { - CreatedDate = createdDate; - ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the date when this private endpoint was created. - /// - [JsonProperty(PropertyName = "createdDate")] - public string CreatedDate { get; private set; } - - /// - /// Gets or sets a list of connections to the remote resource. - /// Immutable after it is set. - /// - [JsonProperty(PropertyName = "manualPrivateLinkServiceConnections")] - public IList ManualPrivateLinkServiceConnections { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkConnectionState.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkConnectionState.cs deleted file mode 100644 index a443a7ae837d..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkConnectionState.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A collection of read-only information about the state of the connection - /// to the private remote resource. - /// - public partial class PrivateLinkConnectionState - { - /// - /// Initializes a new instance of the PrivateLinkConnectionState class. - /// - public PrivateLinkConnectionState() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateLinkConnectionState class. - /// - /// Indicates whether the connection has been - /// Approved/Rejected/Removed by the owner of the remote - /// resource/service. - /// The reason for approval/rejection of the - /// connection. - /// A message indicating if changes on - /// the service provider require any updates on the consumer. - public PrivateLinkConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string)) - { - Status = status; - Description = description; - ActionsRequired = actionsRequired; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets indicates whether the connection has been - /// Approved/Rejected/Removed by the owner of the remote - /// resource/service. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; private set; } - - /// - /// Gets the reason for approval/rejection of the connection. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } - - /// - /// Gets a message indicating if changes on the service provider - /// require any updates on the consumer. - /// - [JsonProperty(PropertyName = "actionsRequired")] - public string ActionsRequired { get; private set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkServiceConnection.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkServiceConnection.cs deleted file mode 100644 index 83523d5e77e0..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/PrivateLinkServiceConnection.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// 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.StreamAnalytics.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A grouping of information about the connection to the remote resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class PrivateLinkServiceConnection - { - /// - /// Initializes a new instance of the PrivateLinkServiceConnection - /// class. - /// - public PrivateLinkServiceConnection() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PrivateLinkServiceConnection - /// class. - /// - /// The resource id of the private - /// link service. Required on PUT (CreateOrUpdate) requests. - /// The ID(s) of the group(s) obtained from the - /// remote resource that this private endpoint should connect to. - /// Required on PUT (CreateOrUpdate) requests. - /// A message passed to the owner of the - /// remote resource with this connection request. Restricted to 140 - /// chars. - /// A collection of - /// read-only information about the state of the connection to the - /// private remote resource. - public PrivateLinkServiceConnection(string privateLinkServiceId = default(string), IList groupIds = default(IList), string requestMessage = default(string), PrivateLinkConnectionState privateLinkServiceConnectionState = default(PrivateLinkConnectionState)) - { - PrivateLinkServiceId = privateLinkServiceId; - GroupIds = groupIds; - RequestMessage = requestMessage; - PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource id of the private link service. Required - /// on PUT (CreateOrUpdate) requests. - /// - [JsonProperty(PropertyName = "properties.privateLinkServiceId")] - public string PrivateLinkServiceId { get; set; } - - /// - /// Gets or sets the ID(s) of the group(s) obtained from the remote - /// resource that this private endpoint should connect to. Required on - /// PUT (CreateOrUpdate) requests. - /// - [JsonProperty(PropertyName = "properties.groupIds")] - public IList GroupIds { get; set; } - - /// - /// Gets or sets a message passed to the owner of the remote resource - /// with this connection request. Restricted to 140 chars. - /// - [JsonProperty(PropertyName = "properties.requestMessage")] - public string RequestMessage { get; set; } - - /// - /// Gets or sets a collection of read-only information about the state - /// of the connection to the private remote resource. - /// - [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] - public PrivateLinkConnectionState PrivateLinkServiceConnectionState { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs index 346e95f5a40c..32e223c231ef 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes an input data source that contains reference data. /// - [Newtonsoft.Json.JsonObject("ReferenceInputDataSource")] public partial class ReferenceInputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs index a81f9df82872..5655cb74f349 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes how data from an input is serialized or how data is /// serialized when written to an output. /// - [Newtonsoft.Json.JsonObject("Serialization")] public partial class Serialization { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs index 830160b86437..0b4be6974476 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes an input data source that contains stream data. /// - [Newtonsoft.Json.JsonObject("StreamInputDataSource")] public partial class StreamInputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs index f555eac45025..f589b50324de 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs @@ -350,13 +350,13 @@ public StreamingJob() public JobStorageAccount JobStorageAccount { get; set; } /// - /// Gets valid values are JobStorageAccount and SystemAccount. If set - /// to JobStorageAccount, this requires the user to also specify + /// Gets or sets valid values are JobStorageAccount and SystemAccount. + /// If set to JobStorageAccount, this requires the user to also specify /// jobStorageAccount property. Possible values include: /// 'SystemAccount', 'JobStorageAccount' /// [JsonProperty(PropertyName = "properties.contentStoragePolicy")] - public string ContentStoragePolicy { get; private set; } + public string ContentStoragePolicy { get; set; } /// /// Gets or sets the storage account where the custom code artifacts diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs index 99665656166d..cfdaae153359 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs @@ -65,12 +65,28 @@ internal Operations(StreamAnalyticsManagementClient client) /// /// 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)) { - string apiVersion = "2017-04-01-preview"; + 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; @@ -78,7 +94,6 @@ internal Operations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +101,9 @@ internal Operations(StreamAnalyticsManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.StreamAnalytics/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs index 51a7d1d75512..87df84a3ea61 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs @@ -104,6 +104,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "output"); } + 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"); @@ -142,7 +153,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "outputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153,7 +163,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) tracingParameters.Add("output", output); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("outputName", outputName); @@ -168,9 +177,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{outputName}", System.Uri.EscapeDataString(outputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -403,6 +412,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "output"); } + 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"); @@ -441,7 +461,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "outputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -451,7 +470,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("output", output); tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("outputName", outputName); @@ -466,9 +484,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{outputName}", System.Uri.EscapeDataString(outputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -654,6 +672,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string jobName, string outputName, 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"); @@ -692,7 +721,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "outputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -700,7 +728,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("outputName", outputName); @@ -715,9 +742,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{outputName}", System.Uri.EscapeDataString(outputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -861,6 +888,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobName, string outputName, 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"); @@ -899,7 +937,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "outputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -907,7 +944,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("outputName", outputName); @@ -922,9 +958,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{outputName}", System.Uri.EscapeDataString(outputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1102,6 +1138,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// public async Task>> ListByStreamingJobWithHttpMessagesAsync(string resourceGroupName, string jobName, string select = default(string), 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"); @@ -1136,7 +1183,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1145,7 +1191,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("select", select); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1162,9 +1207,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1369,6 +1414,17 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// public async Task> BeginTestWithHttpMessagesAsync(string resourceGroupName, string jobName, string outputName, Output output = default(Output), 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"); @@ -1407,7 +1463,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "outputName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1416,7 +1471,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("output", output); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("outputName", outputName); @@ -1431,9 +1485,9 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{outputName}", System.Uri.EscapeDataString(outputName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperations.cs deleted file mode 100644 index 01c11937bc95..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperations.cs +++ /dev/null @@ -1,1159 +0,0 @@ -// -// 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.StreamAnalytics -{ - 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; - - /// - /// PrivateEndpointsOperations operations. - /// - internal partial class PrivateEndpointsOperations : IServiceOperations, IPrivateEndpointsOperations - { - /// - /// Initializes a new instance of the PrivateEndpointsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PrivateEndpointsOperations(StreamAnalyticsManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the StreamAnalyticsManagementClient - /// - public StreamAnalyticsManagementClient Client { get; private set; } - - /// - /// Creates a Stream Analytics Private Endpoint or replaces an already existing - /// Private Endpoint. - /// - /// - /// The definition of the private endpoint that will be used to create a new - /// cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. 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> CreateOrUpdateWithHttpMessagesAsync(PrivateEndpoint privateEndpoint, string resourceGroupName, string clusterName, string privateEndpointName, string ifMatch = default(string), string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (privateEndpoint == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpoint"); - } - 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (privateEndpointName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("privateEndpoint", privateEndpoint); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("privateEndpointName", privateEndpointName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/clusters/{clusterName}/privateEndpoints/{privateEndpointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(privateEndpoint != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpoint, 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Gets information about the specified Private Endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// 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 clusterName, string privateEndpointName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (privateEndpointName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("privateEndpointName", privateEndpointName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}/privateEndpoints/{privateEndpointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string privateEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, privateEndpointName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// 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>> ListByClusterWithHttpMessagesAsync(string resourceGroupName, string clusterName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCluster", 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.StreamAnalytics/clusters/{clusterName}/privateEndpoints").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// 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 clusterName, string privateEndpointName, 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 (clusterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (privateEndpointName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointName"); - } - string apiVersion = "2020-03-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("privateEndpointName", privateEndpointName); - tracingParameters.Add("apiVersion", apiVersion); - 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.StreamAnalytics/clusters/{clusterName}/privateEndpoints/{privateEndpointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - _url = _url.Replace("{privateEndpointName}", System.Uri.EscapeDataString(privateEndpointName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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; - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// 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>> ListByClusterNextWithHttpMessagesAsync(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, "ListByClusterNext", 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - Error _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/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperationsExtensions.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperationsExtensions.cs deleted file mode 100644 index ebe1ebe2a1b4..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/PrivateEndpointsOperationsExtensions.cs +++ /dev/null @@ -1,307 +0,0 @@ -// -// 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.StreamAnalytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PrivateEndpointsOperations. - /// - public static partial class PrivateEndpointsOperationsExtensions - { - /// - /// Creates a Stream Analytics Private Endpoint or replaces an already existing - /// Private Endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the private endpoint that will be used to create a new - /// cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - public static PrivateEndpoint CreateOrUpdate(this IPrivateEndpointsOperations operations, PrivateEndpoint privateEndpoint, string resourceGroupName, string clusterName, string privateEndpointName, string ifMatch = default(string), string ifNoneMatch = default(string)) - { - return operations.CreateOrUpdateAsync(privateEndpoint, resourceGroupName, clusterName, privateEndpointName, ifMatch, ifNoneMatch).GetAwaiter().GetResult(); - } - - /// - /// Creates a Stream Analytics Private Endpoint or replaces an already existing - /// Private Endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The definition of the private endpoint that will be used to create a new - /// cluster or replace the existing one. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The ETag of the resource. Omit this value to always overwrite the current - /// record set. Specify the last-seen ETag value to prevent accidentally - /// overwriting concurrent changes. - /// - /// - /// Set to '*' to allow a new resource to be created, but to prevent updating - /// an existing record set. Other values will result in a 412 Pre-condition - /// Failed response. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPrivateEndpointsOperations operations, PrivateEndpoint privateEndpoint, string resourceGroupName, string clusterName, string privateEndpointName, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(privateEndpoint, resourceGroupName, clusterName, privateEndpointName, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets information about the specified Private Endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - public static PrivateEndpoint Get(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName) - { - return operations.GetAsync(resourceGroupName, clusterName, privateEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Gets information about the specified Private Endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - public static void Delete(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName) - { - operations.DeleteAsync(resourceGroupName, clusterName, privateEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - public static IPage ListByCluster(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName) - { - return operations.ListByClusterAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByClusterAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByClusterWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - public static void BeginDelete(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName) - { - operations.BeginDeleteAsync(resourceGroupName, clusterName, privateEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Delete the specified private endpoint. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the cluster. - /// - /// - /// The name of the private endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IPrivateEndpointsOperations operations, string resourceGroupName, string clusterName, string privateEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, privateEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByClusterNext(this IPrivateEndpointsOperations operations, string nextPageLink) - { - return operations.ListByClusterNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the private endpoints in the cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByClusterNextAsync(this IPrivateEndpointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByClusterNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs index e4e8ff6a0c06..7c7d94eeb08b 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs @@ -19,28 +19,15 @@ public static IEnumerable> ApiInfo_StreamAnalytics { return new Tuple[] { - new Tuple("StreamAnalytics", "Clusters", "2020-03-01-preview"), - new Tuple("StreamAnalytics", "Functions", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "Inputs", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "Operations", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "Outputs", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "PrivateEndpoints", "2020-03-01-preview"), - new Tuple("StreamAnalytics", "StreamingJobs", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "Subscriptions", "2017-04-01-preview"), - new Tuple("StreamAnalytics", "Transformations", "2017-04-01-preview"), + new Tuple("StreamAnalytics", "Functions", "2017-04-01"), + new Tuple("StreamAnalytics", "Inputs", "2017-04-01"), + new Tuple("StreamAnalytics", "Operations", "2017-04-01"), + new Tuple("StreamAnalytics", "Outputs", "2017-04-01"), + new Tuple("StreamAnalytics", "StreamingJobs", "2017-04-01"), + new Tuple("StreamAnalytics", "Subscriptions", "2017-04-01"), + new Tuple("StreamAnalytics", "Transformations", "2017-04-01"), }.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/streamanalytics/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\shangsu\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5325e1398eb73e5de8c8a251909763b9e4803150"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamAnalyticsManagementClient.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamAnalyticsManagementClient.cs index 889afc74734e..f971ff3168ec 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamAnalyticsManagementClient.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamAnalyticsManagementClient.cs @@ -51,6 +51,11 @@ public partial class StreamAnalyticsManagementClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + /// /// The preferred language for the response. /// @@ -79,6 +84,11 @@ public partial class StreamAnalyticsManagementClient : ServiceClient public virtual IInputsOperations Inputs { get; private set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Gets the IOutputsOperations. /// @@ -99,21 +109,6 @@ public partial class StreamAnalyticsManagementClient : ServiceClient public virtual ITransformationsOperations Transformations { get; private set; } - /// - /// Gets the IOperations. - /// - public virtual IOperations Operations { get; private set; } - - /// - /// Gets the IClustersOperations. - /// - public virtual IClustersOperations Clusters { get; private set; } - - /// - /// Gets the IPrivateEndpointsOperations. - /// - public virtual IPrivateEndpointsOperations PrivateEndpoints { get; private set; } - /// /// Initializes a new instance of the StreamAnalyticsManagementClient class. /// @@ -357,14 +352,13 @@ private void Initialize() { Functions = new FunctionsOperations(this); Inputs = new InputsOperations(this); + Operations = new Operations(this); Outputs = new OutputsOperations(this); StreamingJobs = new StreamingJobsOperations(this); Subscriptions = new SubscriptionsOperations(this); Transformations = new TransformationsOperations(this); - Operations = new Operations(this); - Clusters = new ClustersOperations(this); - PrivateEndpoints = new PrivateEndpointsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2017-04-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs index 68704afdce88..bbf948234b19 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs @@ -136,6 +136,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingJob"); } + 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"); @@ -170,7 +181,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -180,7 +190,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("streamingJob", streamingJob); tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -193,9 +202,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -410,6 +419,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobName, string expand = default(string), 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"); @@ -444,7 +464,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -453,7 +472,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("expand", expand); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -470,9 +488,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -648,6 +666,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), 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"); @@ -678,7 +707,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -687,7 +715,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("expand", expand); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); @@ -702,9 +729,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -864,6 +891,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(string expand = default(string), 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"); @@ -875,7 +913,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -884,7 +921,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("expand", expand); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -897,9 +933,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1125,6 +1161,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "streamingJob"); } + 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"); @@ -1159,7 +1206,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1170,7 +1216,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) tracingParameters.Add("streamingJob", streamingJob); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1183,9 +1228,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1394,6 +1439,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string jobName, 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"); @@ -1428,7 +1484,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1436,7 +1491,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1449,9 +1503,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1593,6 +1647,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string jobName, StartStreamingJobParameters startJobParameters = default(StartStreamingJobParameters), 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"); @@ -1627,7 +1692,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1636,7 +1700,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("startJobParameters", startJobParameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1649,9 +1712,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1796,6 +1859,17 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string jobName, 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"); @@ -1830,7 +1904,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1838,7 +1911,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1851,9 +1923,9 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs index 7c38bf1c710d..abb823325729 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs @@ -86,6 +86,17 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } + 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"); @@ -97,7 +108,6 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -106,7 +116,6 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListQuotas", tracingParameters); } @@ -116,9 +125,9 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs index 3969ceef4a45..1a5cac9ea707 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs @@ -104,6 +104,17 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformation"); } + 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"); @@ -142,7 +153,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformationName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -153,7 +163,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) tracingParameters.Add("transformation", transformation); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("ifNoneMatch", ifNoneMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("transformationName", transformationName); @@ -168,9 +177,9 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{transformationName}", System.Uri.EscapeDataString(transformationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -404,6 +413,17 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformation"); } + 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"); @@ -442,7 +462,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformationName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -452,7 +471,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("transformation", transformation); tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("transformationName", transformationName); @@ -467,9 +485,9 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{transformationName}", System.Uri.EscapeDataString(transformationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -658,6 +676,17 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string jobName, string transformationName, 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"); @@ -696,7 +725,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "transformationName"); } - string apiVersion = "2017-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,7 +732,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("transformationName", transformationName); @@ -719,9 +746,9 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{transformationName}", System.Uri.EscapeDataString(transformationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) {