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..96259ed1efe8 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs @@ -83,7 +83,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -254,14 +263,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +279,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -382,7 +386,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -403,6 +407,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 +456,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 +465,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 +479,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) { @@ -544,14 +557,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -561,10 +573,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -640,7 +648,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -654,6 +662,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 +711,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 +718,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 +732,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) { @@ -779,14 +796,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -796,10 +812,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -844,7 +856,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -861,6 +873,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 +922,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 +929,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 +943,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) { @@ -986,14 +1007,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1003,10 +1023,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1085,7 +1101,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1102,6 +1118,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 +1163,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 +1171,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 +1187,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) { @@ -1226,14 +1251,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1243,10 +1267,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1350,7 +1370,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1367,6 +1387,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 +1436,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 +1444,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); @@ -1423,15 +1452,15 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } // 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/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/retrieveDefaultDefinition").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _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) { @@ -1499,14 +1528,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1516,10 +1544,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1593,7 +1617,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1610,6 +1634,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 +1683,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 +1691,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 +1705,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) { @@ -1742,14 +1775,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1759,10 +1791,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1819,7 +1847,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1915,14 +1943,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1932,10 +1959,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); 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/IFunctionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs index 9897e987b83a..49fe68aef8bc 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs @@ -56,7 +56,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -128,7 +128,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -153,7 +153,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,7 +184,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -224,7 +224,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -257,7 +257,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -297,7 +297,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -319,7 +319,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs index 345445299276..406fe2f8bd4e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs @@ -56,7 +56,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -127,7 +127,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -152,7 +152,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -183,7 +183,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -221,7 +221,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -259,7 +259,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -281,7 +281,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs index 6a1409c3269e..e7aabe038715 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs index 6bb2591b0645..834704ee0888 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs @@ -56,7 +56,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -127,7 +127,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -152,7 +152,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -183,7 +183,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -221,7 +221,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -259,7 +259,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -281,7 +281,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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..112e6955e7f1 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. /// @@ -65,9 +70,14 @@ public partial interface IStreamAnalyticsManagementClient : System.IDisposable /// - /// Gets the IFunctionsOperations. + /// Gets the IOperations. /// - IFunctionsOperations Functions { get; } + IOperations Operations { get; } + + /// + /// Gets the IStreamingJobsOperations. + /// + IStreamingJobsOperations StreamingJobs { get; } /// /// Gets the IInputsOperations. @@ -79,35 +89,20 @@ public partial interface IStreamAnalyticsManagementClient : System.IDisposable /// IOutputsOperations Outputs { get; } - /// - /// Gets the IStreamingJobsOperations. - /// - IStreamingJobsOperations StreamingJobs { get; } - - /// - /// Gets the ISubscriptionsOperations. - /// - ISubscriptionsOperations Subscriptions { get; } - /// /// Gets the ITransformationsOperations. /// ITransformationsOperations Transformations { get; } /// - /// Gets the IOperations. - /// - IOperations Operations { get; } - - /// - /// Gets the IClustersOperations. + /// Gets the IFunctionsOperations. /// - IClustersOperations Clusters { get; } + IFunctionsOperations Functions { get; } /// - /// Gets the IPrivateEndpointsOperations. + /// Gets the ISubscriptionsOperations. /// - IPrivateEndpointsOperations PrivateEndpoints { get; } + ISubscriptionsOperations Subscriptions { get; } } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs index 0bf2575a402d..5702b499fb58 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs @@ -53,7 +53,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -93,7 +93,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -118,7 +118,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -147,7 +147,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -176,7 +176,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -202,7 +202,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -231,7 +231,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -254,7 +254,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -262,6 +262,31 @@ public partial interface IStreamingJobsOperations /// Task StopWithHttpMessagesAsync(string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Scales a streaming job when the job is running. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// 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 ScaleWithHttpMessagesAsync(string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates a streaming job or replaces an already existing streaming /// job. /// @@ -291,7 +316,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -316,7 +341,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -342,7 +367,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -365,7 +390,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -373,6 +398,31 @@ public partial interface IStreamingJobsOperations /// Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string jobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Scales a streaming job when the job is running. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// 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 BeginScaleWithHttpMessagesAsync(string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all of the streaming jobs in the specified resource group. /// /// @@ -384,7 +434,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -406,7 +456,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs index 5a0bdd1262f7..10072f0f590e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs @@ -38,7 +38,7 @@ public partial interface ISubscriptionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs index 64a7516ef810..13e93aaf668f 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs @@ -57,7 +57,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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..f5cc601d01be 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs @@ -83,7 +83,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -258,14 +267,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -275,10 +283,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -386,7 +390,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -407,6 +411,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 +460,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 +469,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 +483,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) { @@ -548,14 +561,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -565,10 +577,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -644,7 +652,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -658,6 +666,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 +715,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 +722,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 +736,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) { @@ -783,14 +800,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -800,10 +816,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -848,7 +860,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -865,6 +877,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 +926,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 +933,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 +947,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) { @@ -990,14 +1011,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1007,10 +1027,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1089,7 +1105,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1106,6 +1122,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 +1167,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 +1175,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 +1191,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) { @@ -1230,14 +1255,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1247,10 +1271,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1356,7 +1376,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1377,6 +1397,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 +1446,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 +1454,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 +1468,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) { @@ -1509,14 +1538,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1526,10 +1554,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1586,7 +1610,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1682,14 +1706,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1699,10 +1722,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AggregateFunctionProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AggregateFunctionProperties.cs deleted file mode 100644 index 67d042b8a6dc..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AggregateFunctionProperties.cs +++ /dev/null @@ -1,54 +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 that are associated with an aggregate function. - /// - [Newtonsoft.Json.JsonObject("Aggregate")] - public partial class AggregateFunctionProperties : FunctionProperties - { - /// - /// Initializes a new instance of the AggregateFunctionProperties - /// class. - /// - public AggregateFunctionProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AggregateFunctionProperties - /// class. - /// - /// The current entity tag for the function. 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. - public AggregateFunctionProperties(string etag = default(string), IList inputs = default(IList), FunctionOutput output = default(FunctionOutput), FunctionBinding binding = default(FunctionBinding)) - : base(etag, inputs, output, binding) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureFunctionOutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureFunctionOutputDataSource.cs deleted file mode 100644 index 640d502badcf..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureFunctionOutputDataSource.cs +++ /dev/null @@ -1,104 +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.Linq; - - /// - /// Defines the metadata of AzureFunctionOutputDataSource - /// - [Newtonsoft.Json.JsonObject("Microsoft.AzureFunction")] - [Rest.Serialization.JsonTransformation] - public partial class AzureFunctionOutputDataSource : OutputDataSource - { - /// - /// Initializes a new instance of the AzureFunctionOutputDataSource - /// class. - /// - public AzureFunctionOutputDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureFunctionOutputDataSource - /// class. - /// - /// The name of your Azure Functions - /// app. - /// The name of the function in your Azure - /// Functions app. - /// If you want to use an Azure Function from - /// another subscription, you can do so by providing the key to access - /// your function. - /// A property that lets you set the maximum - /// size for each output batch that's sent to your Azure function. The - /// input unit is in bytes. By default, this value is 262,144 bytes - /// (256 KB). - /// A property that lets you specify the - /// maximum number of events in each batch that's sent to Azure - /// Functions. The default value is 100. - public AzureFunctionOutputDataSource(string functionAppName = default(string), string functionName = default(string), string apiKey = default(string), double? maxBatchSize = default(double?), double? maxBatchCount = default(double?)) - { - FunctionAppName = functionAppName; - FunctionName = functionName; - ApiKey = apiKey; - MaxBatchSize = maxBatchSize; - MaxBatchCount = maxBatchCount; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of your Azure Functions app. - /// - [JsonProperty(PropertyName = "properties.functionAppName")] - public string FunctionAppName { get; set; } - - /// - /// Gets or sets the name of the function in your Azure Functions app. - /// - [JsonProperty(PropertyName = "properties.functionName")] - public string FunctionName { get; set; } - - /// - /// Gets or sets if you want to use an Azure Function from another - /// subscription, you can do so by providing the key to access your - /// function. - /// - [JsonProperty(PropertyName = "properties.apiKey")] - public string ApiKey { get; set; } - - /// - /// Gets or sets a property that lets you set the maximum size for each - /// output batch that's sent to your Azure function. The input unit is - /// in bytes. By default, this value is 262,144 bytes (256 KB). - /// - [JsonProperty(PropertyName = "properties.maxBatchSize")] - public double? MaxBatchSize { get; set; } - - /// - /// Gets or sets a property that lets you specify the maximum number of - /// events in each batch that's sent to Azure Functions. The default - /// value is 100. - /// - [JsonProperty(PropertyName = "properties.maxBatchCount")] - public double? MaxBatchCount { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionBinding.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionBinding.cs deleted file mode 100644 index 032e19e52057..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionBinding.cs +++ /dev/null @@ -1,114 +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; - - /// - /// The binding to an Azure Machine Learning web service. - /// - [Newtonsoft.Json.JsonObject("Microsoft.MachineLearningServices")] - [Rest.Serialization.JsonTransformation] - public partial class AzureMachineLearningServiceFunctionBinding : FunctionBinding - { - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceFunctionBinding class. - /// - public AzureMachineLearningServiceFunctionBinding() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceFunctionBinding class. - /// - /// The Request-Response execute endpoint of the - /// Azure Machine Learning web service. - /// The API key used to authenticate with - /// Request-Response endpoint. - /// The inputs for the Azure Machine Learning web - /// service endpoint. - /// A list of outputs from the Azure Machine - /// Learning web service endpoint execution. - /// Number between 1 and 10000 describing - /// maximum number of rows for every Azure ML RRS execute request. - /// Default is 1000. - /// The number of parallel - /// requests that will be sent per partition of your job to the machine - /// learning service. Default is 1. - public AzureMachineLearningServiceFunctionBinding(string endpoint = default(string), string apiKey = default(string), IList inputs = default(IList), IList outputs = default(IList), int? batchSize = default(int?), int? numberOfParallelRequests = default(int?)) - { - Endpoint = endpoint; - ApiKey = apiKey; - Inputs = inputs; - Outputs = outputs; - BatchSize = batchSize; - NumberOfParallelRequests = numberOfParallelRequests; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Request-Response execute endpoint of the Azure - /// Machine Learning web service. - /// - [JsonProperty(PropertyName = "properties.endpoint")] - public string Endpoint { get; set; } - - /// - /// Gets or sets the API key used to authenticate with Request-Response - /// endpoint. - /// - [JsonProperty(PropertyName = "properties.apiKey")] - public string ApiKey { get; set; } - - /// - /// Gets or sets the inputs for the Azure Machine Learning web service - /// endpoint. - /// - [JsonProperty(PropertyName = "properties.inputs")] - public IList Inputs { get; set; } - - /// - /// Gets or sets a list of outputs from the Azure Machine Learning web - /// service endpoint execution. - /// - [JsonProperty(PropertyName = "properties.outputs")] - public IList Outputs { get; set; } - - /// - /// Gets or sets number between 1 and 10000 describing maximum number - /// of rows for every Azure ML RRS execute request. Default is 1000. - /// - [JsonProperty(PropertyName = "properties.batchSize")] - public int? BatchSize { get; set; } - - /// - /// Gets or sets the number of parallel requests that will be sent per - /// partition of your job to the machine learning service. Default is - /// 1. - /// - [JsonProperty(PropertyName = "properties.numberOfParallelRequests")] - public int? NumberOfParallelRequests { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters.cs deleted file mode 100644 index cb50473dd77c..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters.cs +++ /dev/null @@ -1,71 +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.Linq; - - /// - /// The parameters needed to retrieve the default function definition for - /// an Azure Machine Learning web service function. - /// - [Newtonsoft.Json.JsonObject("Microsoft.MachineLearningServices")] - [Rest.Serialization.JsonTransformation] - public partial class AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters : FunctionRetrieveDefaultDefinitionParameters - { - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters - /// class. - /// - public AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters - /// class. - /// - /// The Request-Response execute endpoint - /// of the Azure Machine Learning web service. - /// The function type. Possible values include: - /// 'Scalar' - public AzureMachineLearningServiceFunctionRetrieveDefaultDefinitionParameters(string executeEndpoint = default(string), UdfType? udfType = default(UdfType?)) - { - ExecuteEndpoint = executeEndpoint; - UdfType = udfType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Request-Response execute endpoint of the Azure - /// Machine Learning web service. - /// - [JsonProperty(PropertyName = "bindingRetrievalProperties.executeEndpoint")] - public string ExecuteEndpoint { get; set; } - - /// - /// Gets or sets the function type. Possible values include: 'Scalar' - /// - [JsonProperty(PropertyName = "bindingRetrievalProperties.udfType")] - public UdfType? UdfType { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputColumn.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputColumn.cs deleted file mode 100644 index 2e0cb1c5a6bf..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputColumn.cs +++ /dev/null @@ -1,74 +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; - - /// - /// Describes an input column for the Azure Machine Learning web service - /// endpoint. - /// - public partial class AzureMachineLearningServiceInputColumn - { - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceInputColumn class. - /// - public AzureMachineLearningServiceInputColumn() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceInputColumn class. - /// - /// The name of the input column. - /// The (Azure Machine Learning supported) data - /// type of the input column. - /// The zero based index of the function parameter - /// this input maps to. - public AzureMachineLearningServiceInputColumn(string name = default(string), string dataType = default(string), int? mapTo = default(int?)) - { - Name = name; - DataType = dataType; - MapTo = mapTo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the input column. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the (Azure Machine Learning supported) data type of - /// the input column. - /// - [JsonProperty(PropertyName = "dataType")] - public string DataType { get; set; } - - /// - /// Gets or sets the zero based index of the function parameter this - /// input maps to. - /// - [JsonProperty(PropertyName = "mapTo")] - public int? MapTo { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceOutputColumn.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceOutputColumn.cs deleted file mode 100644 index 0dd0b78762bd..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceOutputColumn.cs +++ /dev/null @@ -1,74 +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; - - /// - /// Describes an output column for the Azure Machine Learning web service - /// endpoint. - /// - public partial class AzureMachineLearningServiceOutputColumn - { - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceOutputColumn class. - /// - public AzureMachineLearningServiceOutputColumn() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AzureMachineLearningServiceOutputColumn class. - /// - /// The name of the output column. - /// The (Azure Machine Learning supported) data - /// type of the output column. - /// The zero based index of the function parameter - /// this input maps to. - public AzureMachineLearningServiceOutputColumn(string name = default(string), string dataType = default(string), int? mapTo = default(int?)) - { - Name = name; - DataType = dataType; - MapTo = mapTo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the output column. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the (Azure Machine Learning supported) data type of - /// the output column. - /// - [JsonProperty(PropertyName = "dataType")] - public string DataType { get; set; } - - /// - /// Gets or sets the zero based index of the function parameter this - /// input maps to. - /// - [JsonProperty(PropertyName = "mapTo")] - public int? MapTo { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputs.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputs.cs deleted file mode 100644 index 3e518949ac41..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputs.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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The inputs for the Azure Machine Learning Studio endpoint. - /// - public partial class AzureMachineLearningStudioInputs - { - /// - /// Initializes a new instance of the AzureMachineLearningStudioInputs - /// class. - /// - public AzureMachineLearningStudioInputs() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureMachineLearningStudioInputs - /// class. - /// - /// The name of the input. This is the name provided - /// while authoring the endpoint. - /// A list of input columns for the Azure - /// Machine Learning Studio endpoint. - public AzureMachineLearningStudioInputs(string name = default(string), IList columnNames = default(IList)) - { - Name = name; - ColumnNames = columnNames; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the input. This is the name provided while - /// authoring the endpoint. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets a list of input columns for the Azure Machine Learning - /// Studio endpoint. - /// - [JsonProperty(PropertyName = "columnNames")] - public IList ColumnNames { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionBinding.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionBinding.cs similarity index 73% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionBinding.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionBinding.cs index 4e245c6304a8..228a9e0aca15 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionBinding.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionBinding.cs @@ -18,38 +18,38 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using System.Linq; /// - /// The binding to an Azure Machine Learning Studio. + /// The binding to an Azure Machine Learning web service. /// [Newtonsoft.Json.JsonObject("Microsoft.MachineLearning/WebService")] [Rest.Serialization.JsonTransformation] - public partial class AzureMachineLearningStudioFunctionBinding : FunctionBinding + public partial class AzureMachineLearningWebServiceFunctionBinding : FunctionBinding { /// /// Initializes a new instance of the - /// AzureMachineLearningStudioFunctionBinding class. + /// AzureMachineLearningWebServiceFunctionBinding class. /// - public AzureMachineLearningStudioFunctionBinding() + public AzureMachineLearningWebServiceFunctionBinding() { CustomInit(); } /// /// Initializes a new instance of the - /// AzureMachineLearningStudioFunctionBinding class. + /// AzureMachineLearningWebServiceFunctionBinding class. /// /// The Request-Response execute endpoint of the - /// Azure Machine Learning Studio. Find out more here: + /// Azure Machine Learning web service. Find out more here: /// https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs /// The API key used to authenticate with /// Request-Response endpoint. - /// The inputs for the Azure Machine Learning - /// Studio endpoint. + /// The inputs for the Azure Machine Learning web + /// service endpoint. /// A list of outputs from the Azure Machine - /// Learning Studio endpoint execution. + /// Learning web service endpoint execution. /// Number between 1 and 10000 describing /// maximum number of rows for every Azure ML RRS execute request. /// Default is 1000. - public AzureMachineLearningStudioFunctionBinding(string endpoint = default(string), string apiKey = default(string), AzureMachineLearningStudioInputs inputs = default(AzureMachineLearningStudioInputs), IList outputs = default(IList), int? batchSize = default(int?)) + public AzureMachineLearningWebServiceFunctionBinding(string endpoint = default(string), string apiKey = default(string), AzureMachineLearningWebServiceInputs inputs = default(AzureMachineLearningWebServiceInputs), IList outputs = default(IList), int? batchSize = default(int?)) { Endpoint = endpoint; ApiKey = apiKey; @@ -66,7 +66,7 @@ public AzureMachineLearningStudioFunctionBinding() /// /// Gets or sets the Request-Response execute endpoint of the Azure - /// Machine Learning Studio. Find out more here: + /// Machine Learning web service. Find out more here: /// https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs /// [JsonProperty(PropertyName = "properties.endpoint")] @@ -80,18 +80,18 @@ public AzureMachineLearningStudioFunctionBinding() public string ApiKey { get; set; } /// - /// Gets or sets the inputs for the Azure Machine Learning Studio + /// Gets or sets the inputs for the Azure Machine Learning web service /// endpoint. /// [JsonProperty(PropertyName = "properties.inputs")] - public AzureMachineLearningStudioInputs Inputs { get; set; } + public AzureMachineLearningWebServiceInputs Inputs { get; set; } /// - /// Gets or sets a list of outputs from the Azure Machine Learning - /// Studio endpoint execution. + /// Gets or sets a list of outputs from the Azure Machine Learning web + /// service endpoint execution. /// [JsonProperty(PropertyName = "properties.outputs")] - public IList Outputs { get; set; } + public IList Outputs { get; set; } /// /// Gets or sets number between 1 and 10000 describing maximum number diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.cs similarity index 75% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.cs index a11dee3305af..eb5648f35c6a 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.cs @@ -17,33 +17,33 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The parameters needed to retrieve the default function definition for - /// an Azure Machine Learning Studio function. + /// an Azure Machine Learning web service function. /// [Newtonsoft.Json.JsonObject("Microsoft.MachineLearning/WebService")] [Rest.Serialization.JsonTransformation] - public partial class AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters : FunctionRetrieveDefaultDefinitionParameters + public partial class AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters : FunctionRetrieveDefaultDefinitionParameters { /// /// Initializes a new instance of the - /// AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters + /// AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters /// class. /// - public AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters() + public AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters() { CustomInit(); } /// /// Initializes a new instance of the - /// AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters + /// AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters /// class. /// /// The Request-Response execute endpoint - /// of the Azure Machine Learning Studio. Find out more here: + /// of the Azure Machine Learning web service. Find out more here: /// https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs /// The function type. Possible values include: /// 'Scalar' - public AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters(string executeEndpoint = default(string), UdfType? udfType = default(UdfType?)) + public AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters(string executeEndpoint = default(string), UdfType? udfType = default(UdfType?)) { ExecuteEndpoint = executeEndpoint; UdfType = udfType; @@ -57,7 +57,7 @@ public AzureMachineLearningStudioFunctionRetrieveDefaultDefinitionParameters() /// /// Gets or sets the Request-Response execute endpoint of the Azure - /// Machine Learning Studio. Find out more here: + /// Machine Learning web service. Find out more here: /// https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs /// [JsonProperty(PropertyName = "bindingRetrievalProperties.executeEndpoint")] diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputColumn.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputColumn.cs similarity index 85% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputColumn.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputColumn.cs index 85339833c8a4..ca6fb8dcf23e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioInputColumn.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputColumn.cs @@ -14,23 +14,23 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using System.Linq; /// - /// Describes an input column for the Azure Machine Learning Studio + /// Describes an input column for the Azure Machine Learning web service /// endpoint. /// - public partial class AzureMachineLearningStudioInputColumn + public partial class AzureMachineLearningWebServiceInputColumn { /// /// Initializes a new instance of the - /// AzureMachineLearningStudioInputColumn class. + /// AzureMachineLearningWebServiceInputColumn class. /// - public AzureMachineLearningStudioInputColumn() + public AzureMachineLearningWebServiceInputColumn() { CustomInit(); } /// /// Initializes a new instance of the - /// AzureMachineLearningStudioInputColumn class. + /// AzureMachineLearningWebServiceInputColumn class. /// /// The name of the input column. /// The (Azure Machine Learning supported) data @@ -40,7 +40,7 @@ public AzureMachineLearningStudioInputColumn() /// . /// The zero based index of the function parameter /// this input maps to. - public AzureMachineLearningStudioInputColumn(string name = default(string), string dataType = default(string), int? mapTo = default(int?)) + public AzureMachineLearningWebServiceInputColumn(string name = default(string), string dataType = default(string), int? mapTo = default(int?)) { Name = name; DataType = dataType; diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputs.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputs.cs similarity index 74% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputs.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputs.cs index d2604ac739af..37ba9ed0d41a 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningServiceInputs.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceInputs.cs @@ -18,26 +18,26 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The inputs for the Azure Machine Learning web service endpoint. /// - public partial class AzureMachineLearningServiceInputs + public partial class AzureMachineLearningWebServiceInputs { /// - /// Initializes a new instance of the AzureMachineLearningServiceInputs - /// class. + /// Initializes a new instance of the + /// AzureMachineLearningWebServiceInputs class. /// - public AzureMachineLearningServiceInputs() + public AzureMachineLearningWebServiceInputs() { CustomInit(); } /// - /// Initializes a new instance of the AzureMachineLearningServiceInputs - /// class. + /// Initializes a new instance of the + /// AzureMachineLearningWebServiceInputs class. /// /// The name of the input. This is the name provided /// while authoring the endpoint. /// A list of input columns for the Azure /// Machine Learning web service endpoint. - public AzureMachineLearningServiceInputs(string name = default(string), IList columnNames = default(IList)) + public AzureMachineLearningWebServiceInputs(string name = default(string), IList columnNames = default(IList)) { Name = name; ColumnNames = columnNames; @@ -61,7 +61,7 @@ public AzureMachineLearningServiceInputs() /// web service endpoint. /// [JsonProperty(PropertyName = "columnNames")] - public IList ColumnNames { get; set; } + public IList ColumnNames { get; set; } } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioOutputColumn.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceOutputColumn.cs similarity index 84% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioOutputColumn.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceOutputColumn.cs index d30c659cc59f..54861c75968f 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningStudioOutputColumn.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureMachineLearningWebServiceOutputColumn.cs @@ -14,23 +14,23 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using System.Linq; /// - /// Describes an output column for the Azure Machine Learning Studio + /// Describes an output column for the Azure Machine Learning web service /// endpoint. /// - public partial class AzureMachineLearningStudioOutputColumn + public partial class AzureMachineLearningWebServiceOutputColumn { /// /// Initializes a new instance of the - /// AzureMachineLearningStudioOutputColumn class. + /// AzureMachineLearningWebServiceOutputColumn class. /// - public AzureMachineLearningStudioOutputColumn() + public AzureMachineLearningWebServiceOutputColumn() { CustomInit(); } /// /// Initializes a new instance of the - /// AzureMachineLearningStudioOutputColumn class. + /// AzureMachineLearningWebServiceOutputColumn class. /// /// The name of the output column. /// The (Azure Machine Learning supported) data @@ -38,7 +38,7 @@ public AzureMachineLearningStudioOutputColumn() /// data types are described at /// https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx /// . - public AzureMachineLearningStudioOutputColumn(string name = default(string), string dataType = default(string)) + public AzureMachineLearningWebServiceOutputColumn(string name = default(string), string dataType = default(string)) { Name = name; DataType = dataType; diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseDataSourceProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseDataSourceProperties.cs index 0547b0b90ec9..e4c712f90a8d 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseDataSourceProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseDataSourceProperties.cs @@ -48,7 +48,7 @@ public AzureSqlDatabaseDataSourceProperties() /// Max Batch count for write to Sql /// database, the default value is 10,000. Optional on PUT /// requests. - /// Max Write r count, currently only + /// Max Writer count, currently only /// 1(single writer) and 0(based on query partition) are available. /// Optional on PUT requests. /// Authentication Mode. Possible @@ -114,7 +114,7 @@ public AzureSqlDatabaseDataSourceProperties() public double? MaxBatchCount { get; set; } /// - /// Gets or sets max Write r count, currently only 1(single writer) and + /// Gets or sets max Writer count, currently only 1(single writer) and /// 0(based on query partition) are available. Optional on PUT /// requests. /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseOutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseOutputDataSource.cs index c2a9c8aa3c72..e70e2b895a53 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseOutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlDatabaseOutputDataSource.cs @@ -51,7 +51,7 @@ public AzureSqlDatabaseOutputDataSource() /// Max Batch count for write to Sql /// database, the default value is 10,000. Optional on PUT /// requests. - /// Max Write r count, currently only + /// Max Writer count, currently only /// 1(single writer) and 0(based on query partition) are available. /// Optional on PUT requests. /// Authentication Mode. Possible @@ -117,7 +117,7 @@ public AzureSqlDatabaseOutputDataSource() public double? MaxBatchCount { get; set; } /// - /// Gets or sets max Write r count, currently only 1(single writer) and + /// Gets or sets max Writer count, currently only 1(single writer) and /// 0(based on query partition) are available. Optional on PUT /// requests. /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSource.cs index 176168c7fcee..b8bacba5cb60 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSource.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; @@ -17,6 +19,7 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// Describes an Azure SQL database reference input data source. /// [Newtonsoft.Json.JsonObject("Microsoft.Sql/Server/Database")] + [Rest.Serialization.JsonTransformation] public partial class AzureSqlReferenceInputDataSource : ReferenceInputDataSource { /// @@ -32,9 +35,45 @@ public AzureSqlReferenceInputDataSource() /// Initializes a new instance of the AzureSqlReferenceInputDataSource /// class. /// - public AzureSqlReferenceInputDataSource(AzureSqlReferenceInputDataSourceProperties properties = default(AzureSqlReferenceInputDataSourceProperties)) + /// This element is associated with the datasource + /// element. This is the name of the server that contains the database + /// that will be written to. + /// This element is associated with the + /// datasource element. This is the name of the database that output + /// will be written to. + /// This element is associated with the datasource + /// element. This is the user name that will be used to connect to the + /// SQL Database instance. + /// This element is associated with the + /// datasource element. This is the password that will be used to + /// connect to the SQL Database instance. + /// This element is associated with the datasource + /// element. The name of the table in the Azure SQL database.. + /// Indicates the type of data refresh + /// option. Possible values include: 'Static', + /// 'RefreshPeriodicallyWithFull', + /// 'RefreshPeriodicallyWithDelta' + /// This element is associated with the + /// datasource element. This indicates how frequently the data will be + /// fetched from the database. It is of DateTime format. + /// This element is associated with the + /// datasource element. This query is used to fetch data from the sql + /// database. + /// This element is associated with + /// the datasource element. This query is used to fetch incremental + /// changes from the SQL database. To use this option, we recommend + /// using temporal tables in Azure SQL Database. + public AzureSqlReferenceInputDataSource(string server = default(string), string database = default(string), string user = default(string), string password = default(string), string table = default(string), string refreshType = default(string), string refreshRate = default(string), string fullSnapshotQuery = default(string), string deltaSnapshotQuery = default(string)) { - Properties = properties; + Server = server; + Database = database; + User = user; + Password = password; + Table = table; + RefreshType = refreshType; + RefreshRate = refreshRate; + FullSnapshotQuery = fullSnapshotQuery; + DeltaSnapshotQuery = deltaSnapshotQuery; CustomInit(); } @@ -44,9 +83,75 @@ public AzureSqlReferenceInputDataSource() partial void CustomInit(); /// + /// Gets or sets this element is associated with the datasource + /// element. This is the name of the server that contains the database + /// that will be written to. /// - [JsonProperty(PropertyName = "properties")] - public AzureSqlReferenceInputDataSourceProperties Properties { get; set; } + [JsonProperty(PropertyName = "properties.server")] + public string Server { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This is the name of the database that output will be + /// written to. + /// + [JsonProperty(PropertyName = "properties.database")] + public string Database { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This is the user name that will be used to connect to the + /// SQL Database instance. + /// + [JsonProperty(PropertyName = "properties.user")] + public string User { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This is the password that will be used to connect to the + /// SQL Database instance. + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. The name of the table in the Azure SQL database.. + /// + [JsonProperty(PropertyName = "properties.table")] + public string Table { get; set; } + + /// + /// Gets or sets indicates the type of data refresh option. Possible + /// values include: 'Static', 'RefreshPeriodicallyWithFull', + /// 'RefreshPeriodicallyWithDelta' + /// + [JsonProperty(PropertyName = "properties.refreshType")] + public string RefreshType { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This indicates how frequently the data will be fetched + /// from the database. It is of DateTime format. + /// + [JsonProperty(PropertyName = "properties.refreshRate")] + public string RefreshRate { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This query is used to fetch data from the sql database. + /// + [JsonProperty(PropertyName = "properties.fullSnapshotQuery")] + public string FullSnapshotQuery { get; set; } + + /// + /// Gets or sets this element is associated with the datasource + /// element. This query is used to fetch incremental changes from the + /// SQL database. To use this option, we recommend using temporal + /// tables in Azure SQL Database. + /// + [JsonProperty(PropertyName = "properties.deltaSnapshotQuery")] + public string DeltaSnapshotQuery { get; set; } } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs deleted file mode 100644 index 01358220ee7e..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs +++ /dev/null @@ -1,151 +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; - - public partial class AzureSqlReferenceInputDataSourceProperties - { - /// - /// Initializes a new instance of the - /// AzureSqlReferenceInputDataSourceProperties class. - /// - public AzureSqlReferenceInputDataSourceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AzureSqlReferenceInputDataSourceProperties class. - /// - /// This element is associated with the datasource - /// element. This is the name of the server that contains the database - /// that will be written to. - /// This element is associated with the - /// datasource element. This is the name of the database that output - /// will be written to. - /// This element is associated with the datasource - /// element. This is the user name that will be used to connect to the - /// SQL Database instance. - /// This element is associated with the - /// datasource element. This is the password that will be used to - /// connect to the SQL Database instance. - /// This element is associated with the datasource - /// element. The name of the table in the Azure SQL database.. - /// This element is associated with the - /// datasource element. This element is of enum type. It indicates what - /// kind of data refresh option do we want to - /// use:Static/RefreshPeriodicallyWithFull/RefreshPeriodicallyWithDelta - /// This element is associated with the - /// datasource element. This indicates how frequently the data will be - /// fetched from the database. It is of DateTime format. - /// This element is associated with the - /// datasource element. This query is used to fetch data from the sql - /// database. - /// This element is associated with - /// the datasource element. This query is used to fetch incremental - /// changes from the SQL database. To use this option, we recommend - /// using temporal tables in Azure SQL Database. - public AzureSqlReferenceInputDataSourceProperties(string server = default(string), string database = default(string), string user = default(string), string password = default(string), string table = default(string), string refreshType = default(string), string refreshRate = default(string), string fullSnapshotQuery = default(string), string deltaSnapshotQuery = default(string)) - { - Server = server; - Database = database; - User = user; - Password = password; - Table = table; - RefreshType = refreshType; - RefreshRate = refreshRate; - FullSnapshotQuery = fullSnapshotQuery; - DeltaSnapshotQuery = deltaSnapshotQuery; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets this element is associated with the datasource - /// element. This is the name of the server that contains the database - /// that will be written to. - /// - [JsonProperty(PropertyName = "server")] - public string Server { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This is the name of the database that output will be - /// written to. - /// - [JsonProperty(PropertyName = "database")] - public string Database { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This is the user name that will be used to connect to the - /// SQL Database instance. - /// - [JsonProperty(PropertyName = "user")] - public string User { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This is the password that will be used to connect to the - /// SQL Database instance. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. The name of the table in the Azure SQL database.. - /// - [JsonProperty(PropertyName = "table")] - public string Table { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This element is of enum type. It indicates what kind of - /// data refresh option do we want to - /// use:Static/RefreshPeriodicallyWithFull/RefreshPeriodicallyWithDelta - /// - [JsonProperty(PropertyName = "refreshType")] - public string RefreshType { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This indicates how frequently the data will be fetched - /// from the database. It is of DateTime format. - /// - [JsonProperty(PropertyName = "refreshRate")] - public string RefreshRate { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This query is used to fetch data from the sql database. - /// - [JsonProperty(PropertyName = "fullSnapshotQuery")] - public string FullSnapshotQuery { get; set; } - - /// - /// Gets or sets this element is associated with the datasource - /// element. This query is used to fetch incremental changes from the - /// SQL database. To use this option, we recommend using temporal - /// tables in Azure SQL Database. - /// - [JsonProperty(PropertyName = "deltaSnapshotQuery")] - public string DeltaSnapshotQuery { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionBinding.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionBinding.cs deleted file mode 100644 index 4d2efc454988..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionBinding.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 Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The binding to a CSharp function. - /// - [Newtonsoft.Json.JsonObject("Microsoft.StreamAnalytics/CLRUdf")] - [Rest.Serialization.JsonTransformation] - public partial class CSharpFunctionBinding : FunctionBinding - { - /// - /// Initializes a new instance of the CSharpFunctionBinding class. - /// - public CSharpFunctionBinding() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CSharpFunctionBinding class. - /// - /// The Csharp code containing a single function - /// definition. - /// The Csharp code containing a single function - /// definition. - /// The Csharp code containing a single - /// function definition. - /// The Csharp code containing a single function - /// definition. - public CSharpFunctionBinding(string script = default(string), string dllPath = default(string), string classProperty = default(string), string method = default(string)) - { - Script = script; - DllPath = dllPath; - ClassProperty = classProperty; - Method = method; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Csharp code containing a single function - /// definition. - /// - [JsonProperty(PropertyName = "properties.script")] - public string Script { get; set; } - - /// - /// Gets or sets the Csharp code containing a single function - /// definition. - /// - [JsonProperty(PropertyName = "properties.dllPath")] - public string DllPath { get; set; } - - /// - /// Gets or sets the Csharp code containing a single function - /// definition. - /// - [JsonProperty(PropertyName = "properties.class")] - public string ClassProperty { get; set; } - - /// - /// Gets or sets the Csharp code containing a single function - /// definition. - /// - [JsonProperty(PropertyName = "properties.method")] - public string Method { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionRetrieveDefaultDefinitionParameters.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionRetrieveDefaultDefinitionParameters.cs deleted file mode 100644 index 3be155c592a4..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CSharpFunctionRetrieveDefaultDefinitionParameters.cs +++ /dev/null @@ -1,69 +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.Linq; - - /// - /// The parameters needed to retrieve the default function definition for a - /// CSharp function. - /// - [Newtonsoft.Json.JsonObject("Microsoft.StreamAnalytics/CLRUdf")] - [Rest.Serialization.JsonTransformation] - public partial class CSharpFunctionRetrieveDefaultDefinitionParameters : FunctionRetrieveDefaultDefinitionParameters - { - /// - /// Initializes a new instance of the - /// CSharpFunctionRetrieveDefaultDefinitionParameters class. - /// - public CSharpFunctionRetrieveDefaultDefinitionParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CSharpFunctionRetrieveDefaultDefinitionParameters class. - /// - /// The CSharp code containing a single function - /// definition. - /// The function type. Possible values include: - /// 'Scalar' - public CSharpFunctionRetrieveDefaultDefinitionParameters(string script = default(string), UdfType? udfType = default(UdfType?)) - { - Script = script; - UdfType = udfType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the CSharp code containing a single function - /// definition. - /// - [JsonProperty(PropertyName = "bindingRetrievalProperties.script")] - public string Script { get; set; } - - /// - /// Gets or sets the function type. Possible values include: 'Scalar' - /// - [JsonProperty(PropertyName = "bindingRetrievalProperties.udfType")] - public UdfType? UdfType { get; set; } - - } -} 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/CompatibilityLevel.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompatibilityLevel.cs index a3d185b4db6d..f61b70ea4d79 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompatibilityLevel.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompatibilityLevel.cs @@ -17,5 +17,6 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models public static class CompatibilityLevel { public const string OneFullStopZero = "1.0"; + public const string OneFullStopTwo = "1.2"; } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Compression.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Compression.cs index 1fb50277f8b8..f51aef71fe38 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Compression.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Compression.cs @@ -30,6 +30,9 @@ public Compression() /// /// Initializes a new instance of the Compression class. /// + /// Indicates the type of compression that the input + /// uses. Required on PUT (CreateOrReplace) requests. Possible values + /// include: 'None', 'GZip', 'Deflate' public Compression(string type) { Type = type; @@ -42,6 +45,9 @@ public Compression(string type) partial void CustomInit(); /// + /// Gets or sets indicates the type of compression that the input uses. + /// Required on PUT (CreateOrReplace) requests. Possible values + /// include: 'None', 'GZip', 'Deflate' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompressionType.cs similarity index 68% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompressionType.cs index 3137e47292f3..33fde1f86b8b 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ClusterSkuName.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompressionType.cs @@ -12,13 +12,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { /// - /// Defines values for ClusterSkuName. + /// Defines values for CompressionType. /// - public static class ClusterSkuName + public static class CompressionType { - /// - /// The default SKU. - /// - public const string Default = "Default"; + public const string None = "None"; + public const string GZip = "GZip"; + public const string Deflate = "Deflate"; } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CustomClrSerialization.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CustomClrSerialization.cs deleted file mode 100644 index c2e8c1a4202e..000000000000 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CustomClrSerialization.cs +++ /dev/null @@ -1,66 +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.Linq; - - /// - /// Describes how data from an input is serialized or how data is - /// serialized when written to an output in custom format. - /// - [Newtonsoft.Json.JsonObject("CustomClr")] - [Rest.Serialization.JsonTransformation] - public partial class CustomClrSerialization : Serialization - { - /// - /// Initializes a new instance of the CustomClrSerialization class. - /// - public CustomClrSerialization() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomClrSerialization class. - /// - /// The serialization library - /// path. - /// The serialization class - /// name. - public CustomClrSerialization(string serializationDllPath = default(string), string serializationClassName = default(string)) - { - SerializationDllPath = serializationDllPath; - SerializationClassName = serializationClassName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the serialization library path. - /// - [JsonProperty(PropertyName = "properties.serializationDllPath")] - public string SerializationDllPath { get; set; } - - /// - /// Gets or sets the serialization class name. - /// - [JsonProperty(PropertyName = "properties.serializationClassName")] - public string SerializationClassName { get; set; } - - } -} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubOutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubOutputDataSource.cs index c2b6136bb834..3d1823489b4f 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubOutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubOutputDataSource.cs @@ -50,6 +50,8 @@ public EventHubOutputDataSource() /// PUT (CreateOrReplace) requests. /// The key/column that is used to determine /// to which partition to send event data. + /// The properties associated with this + /// Event Hub output. public EventHubOutputDataSource(string serviceBusNamespace = default(string), string sharedAccessPolicyName = default(string), string sharedAccessPolicyKey = default(string), string authenticationMode = default(string), string eventHubName = default(string), string partitionKey = default(string), IList propertyColumns = default(IList)) { ServiceBusNamespace = serviceBusNamespace; @@ -112,6 +114,7 @@ public EventHubOutputDataSource() public string PartitionKey { get; set; } /// + /// Gets or sets the properties associated with this Event Hub output. /// [JsonProperty(PropertyName = "properties.propertyColumns")] public IList PropertyColumns { get; set; } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubV2OutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubV2OutputDataSource.cs index 9b77a9da132e..9a66696c64df 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubV2OutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventHubV2OutputDataSource.cs @@ -50,6 +50,8 @@ public EventHubV2OutputDataSource() /// PUT (CreateOrReplace) requests. /// The key/column that is used to determine /// to which partition to send event data. + /// The properties associated with this + /// Event Hub output. public EventHubV2OutputDataSource(string serviceBusNamespace = default(string), string sharedAccessPolicyName = default(string), string sharedAccessPolicyKey = default(string), string authenticationMode = default(string), string eventHubName = default(string), string partitionKey = default(string), IList propertyColumns = default(IList)) { ServiceBusNamespace = serviceBusNamespace; @@ -112,6 +114,7 @@ public EventHubV2OutputDataSource() public string PartitionKey { get; set; } /// + /// Gets or sets the properties associated with this Event Hub output. /// [JsonProperty(PropertyName = "properties.propertyColumns")] public IList PropertyColumns { get; set; } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventSerializationType.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventSerializationType.cs index e9bff50a62a8..cea379d7741e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventSerializationType.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/EventSerializationType.cs @@ -19,7 +19,6 @@ public static class EventSerializationType public const string Csv = "Csv"; public const string Avro = "Avro"; public const string Json = "Json"; - public const string CustomClr = "CustomClr"; public const string Parquet = "Parquet"; } } 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..e6110547d580 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 @@ -10,18 +10,12 @@ 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; /// /// The properties that are associated with a function. /// - [Newtonsoft.Json.JsonObject("FunctionProperties")] - [Rest.Serialization.JsonTransformation] public partial class FunctionProperties { /// @@ -40,12 +34,9 @@ public FunctionProperties() /// changed between requests. You can also use it in the If-Match or /// If-None-Match headers for write operations for optimistic /// concurrency. - public FunctionProperties(string etag = default(string), IList inputs = default(IList), FunctionOutput output = default(FunctionOutput), FunctionBinding binding = default(FunctionBinding)) + public FunctionProperties(string etag = default(string)) { Etag = etag; - Inputs = inputs; - Output = output; - Binding = binding; CustomInit(); } @@ -64,20 +55,5 @@ public FunctionProperties() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// - [JsonProperty(PropertyName = "properties.inputs")] - public IList Inputs { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.output")] - public FunctionOutput Output { get; set; } - - /// - /// - [JsonProperty(PropertyName = "properties.binding")] - public FunctionBinding Binding { get; set; } - } } 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/Identity.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Identity.cs index e159634afddd..5011c4ae43f8 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Identity.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Identity.cs @@ -29,6 +29,9 @@ public Identity() /// /// Initializes a new instance of the Identity class. /// + /// The identity tenantId + /// The identity principal ID + /// The identity type public Identity(string tenantId = default(string), string principalId = default(string), string type = default(string)) { TenantId = tenantId; @@ -43,16 +46,19 @@ public Identity() partial void CustomInit(); /// + /// Gets or sets the identity tenantId /// [JsonProperty(PropertyName = "tenantId")] public string TenantId { get; set; } /// + /// Gets or sets the identity principal ID /// [JsonProperty(PropertyName = "principalId")] public string PrincipalId { get; set; } /// + /// Gets or sets the identity type /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } 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..79612229dbca 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 { /// @@ -41,6 +40,8 @@ public InputProperties() /// changed between requests. You can also use it in the If-Match or /// If-None-Match headers for write operations for optimistic /// concurrency. + /// Describes how input data is + /// compressed /// partitionKey Describes a key in the /// input data which is used for partitioning the input data public InputProperties(Serialization serialization = default(Serialization), Diagnostics diagnostics = default(Diagnostics), string etag = default(string), Compression compression = default(Compression), string partitionKey = default(string)) @@ -84,6 +85,7 @@ public InputProperties() public string Etag { get; private set; } /// + /// Gets or sets describes how input data is compressed /// [JsonProperty(PropertyName = "compression")] public Compression Compression { get; set; } 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/Operation.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Operation.cs index 07fdc6eb557e..5ffdd4f9fe05 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Operation.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Operation.cs @@ -31,11 +31,14 @@ public Operation() /// /// The name of the operation being performed on /// this particular object. + /// Indicates whether the operation is a + /// data action /// Contains the localized display information /// for this particular operation / action. - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay)) { Name = name; + IsDataAction = isDataAction; Display = display; CustomInit(); } @@ -52,6 +55,12 @@ public Operation() [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets or sets indicates whether the operation is a data action + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + /// /// Gets contains the localized display information for this particular /// operation / action. diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Output.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Output.cs index 5e765078a5a9..824bce54a6bc 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Output.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Output.cs @@ -38,6 +38,10 @@ public Output() /// Resource type /// Describes the data source that output will /// be written to. Required on PUT (CreateOrReplace) requests. + /// The time frame for filtering Stream + /// Analytics job outputs. + /// The size window to constrain a Stream + /// Analytics output to. /// Describes how data from an input is /// serialized or how data is serialized when written to an output. /// Required on PUT (CreateOrReplace) requests. @@ -74,11 +78,15 @@ public Output() public OutputDataSource Datasource { get; set; } /// + /// Gets or sets the time frame for filtering Stream Analytics job + /// outputs. /// [JsonProperty(PropertyName = "properties.timeWindow")] public string TimeWindow { get; set; } /// + /// Gets or sets the size window to constrain a Stream Analytics output + /// to. /// [JsonProperty(PropertyName = "properties.sizeWindow")] public double? SizeWindow { get; set; } 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/ReferenceInputProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs index 012c981966ff..54c899ae175e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs @@ -42,6 +42,8 @@ public ReferenceInputProperties() /// changed between requests. You can also use it in the If-Match or /// If-None-Match headers for write operations for optimistic /// concurrency. + /// Describes how input data is + /// compressed /// partitionKey Describes a key in the /// input data which is used for partitioning the input data /// Describes an input data source that diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RefreshType.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RefreshType.cs new file mode 100644 index 000000000000..dc15c8ac4a40 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RefreshType.cs @@ -0,0 +1,23 @@ +// +// 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 RefreshType. + /// + public static class RefreshType + { + public const string Static = "Static"; + public const string RefreshPeriodicallyWithFull = "RefreshPeriodicallyWithFull"; + public const string RefreshPeriodicallyWithDelta = "RefreshPeriodicallyWithDelta"; + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs index 3d7700faf54b..9b1248758b23 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using Newtonsoft.Json; using System.Linq; + /// + /// The base resource definition + /// public partial class Resource : IResource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScalarFunctionProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScalarFunctionProperties.cs index 1f8e400567bd..58d33fc37fb9 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScalarFunctionProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScalarFunctionProperties.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -19,6 +21,7 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// The properties that are associated with a scalar function. /// [Newtonsoft.Json.JsonObject("Scalar")] + [Rest.Serialization.JsonTransformation] public partial class ScalarFunctionProperties : FunctionProperties { /// @@ -37,9 +40,18 @@ public ScalarFunctionProperties() /// changed between requests. You can also use it in the If-Match or /// If-None-Match headers for write operations for optimistic /// concurrency. + /// A list of inputs describing the parameters of + /// the function. + /// The output of the function. + /// The physical binding of the function. For + /// example, in the Azure Machine Learning web service’s case, this + /// describes the endpoint. public ScalarFunctionProperties(string etag = default(string), IList inputs = default(IList), FunctionOutput output = default(FunctionOutput), FunctionBinding binding = default(FunctionBinding)) - : base(etag, inputs, output, binding) + : base(etag) { + Inputs = inputs; + Output = output; + Binding = binding; CustomInit(); } @@ -48,5 +60,26 @@ public ScalarFunctionProperties() /// partial void CustomInit(); + /// + /// Gets or sets a list of inputs describing the parameters of the + /// function. + /// + [JsonProperty(PropertyName = "properties.inputs")] + public IList Inputs { get; set; } + + /// + /// Gets or sets the output of the function. + /// + [JsonProperty(PropertyName = "properties.output")] + public FunctionOutput Output { get; set; } + + /// + /// Gets or sets the physical binding of the function. For example, in + /// the Azure Machine Learning web service’s case, this describes the + /// endpoint. + /// + [JsonProperty(PropertyName = "properties.binding")] + public FunctionBinding Binding { get; set; } + } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/External.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScaleStreamingJobParameters.cs similarity index 50% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/External.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScaleStreamingJobParameters.cs index 46f07fed2ba5..8cab68c7725c 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/External.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ScaleStreamingJobParameters.cs @@ -14,26 +14,28 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using System.Linq; /// - /// The storage account where the custom code artifacts are located. + /// Parameters supplied to the Scale Streaming Job operation. /// - public partial class External + public partial class ScaleStreamingJobParameters { /// - /// Initializes a new instance of the External class. + /// Initializes a new instance of the ScaleStreamingJobParameters + /// class. /// - public External() + public ScaleStreamingJobParameters() { CustomInit(); } /// - /// Initializes a new instance of the External class. + /// Initializes a new instance of the ScaleStreamingJobParameters + /// class. /// - public External(StorageAccount storageAccount = default(StorageAccount), string container = default(string), string path = default(string)) + /// Specifies the number of streaming + /// units that the streaming job will scale to. + public ScaleStreamingJobParameters(int? streamingUnits = default(int?)) { - StorageAccount = storageAccount; - Container = container; - Path = path; + StreamingUnits = streamingUnits; CustomInit(); } @@ -43,19 +45,11 @@ public External() partial void CustomInit(); /// + /// Gets or sets specifies the number of streaming units that the + /// streaming job will scale to. /// - [JsonProperty(PropertyName = "storageAccount")] - public StorageAccount StorageAccount { get; set; } - - /// - /// - [JsonProperty(PropertyName = "container")] - public string Container { get; set; } - - /// - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } + [JsonProperty(PropertyName = "streamingUnits")] + public int? StreamingUnits { get; set; } } } 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/ServiceBusQueueOutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusQueueOutputDataSource.cs index 8d0d76bb9cda..cd6083c569ae 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusQueueOutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusQueueOutputDataSource.cs @@ -53,7 +53,13 @@ public ServiceBusQueueOutputDataSource() /// A string array of the names of output /// columns to be attached to Service Bus messages as custom /// properties. - public ServiceBusQueueOutputDataSource(string serviceBusNamespace = default(string), string sharedAccessPolicyName = default(string), string sharedAccessPolicyKey = default(string), string authenticationMode = default(string), string queueName = default(string), IList propertyColumns = default(IList), IDictionary systemPropertyColumns = default(IDictionary)) + /// The system properties + /// associated with the Service Bus Queue. The following system + /// properties are supported: ReplyToSessionId, ContentType, To, + /// Subject, CorrelationId, TimeToLive, PartitionKey, SessionId, + /// ScheduledEnqueueTime, MessageId, ReplyTo, Label, + /// ScheduledEnqueueTimeUtc. + public ServiceBusQueueOutputDataSource(string serviceBusNamespace = default(string), string sharedAccessPolicyName = default(string), string sharedAccessPolicyKey = default(string), string authenticationMode = default(string), string queueName = default(string), IList propertyColumns = default(IList), object systemPropertyColumns = default(object)) { ServiceBusNamespace = serviceBusNamespace; SharedAccessPolicyName = sharedAccessPolicyName; @@ -115,9 +121,14 @@ public ServiceBusQueueOutputDataSource() public IList PropertyColumns { get; set; } /// + /// Gets or sets the system properties associated with the Service Bus + /// Queue. The following system properties are supported: + /// ReplyToSessionId, ContentType, To, Subject, CorrelationId, + /// TimeToLive, PartitionKey, SessionId, ScheduledEnqueueTime, + /// MessageId, ReplyTo, Label, ScheduledEnqueueTimeUtc. /// [JsonProperty(PropertyName = "properties.systemPropertyColumns")] - public IDictionary SystemPropertyColumns { get; set; } + public object SystemPropertyColumns { get; set; } } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusTopicOutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusTopicOutputDataSource.cs index dc08fd4086c4..79a667facd62 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusTopicOutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ServiceBusTopicOutputDataSource.cs @@ -53,6 +53,12 @@ public ServiceBusTopicOutputDataSource() /// A string array of the names of output /// columns to be attached to Service Bus messages as custom /// properties. + /// The system properties + /// associated with the Service Bus Topic Output. The following system + /// properties are supported: ReplyToSessionId, ContentType, To, + /// Subject, CorrelationId, TimeToLive, PartitionKey, SessionId, + /// ScheduledEnqueueTime, MessageId, ReplyTo, Label, + /// ScheduledEnqueueTimeUtc. public ServiceBusTopicOutputDataSource(string serviceBusNamespace = default(string), string sharedAccessPolicyName = default(string), string sharedAccessPolicyKey = default(string), string authenticationMode = default(string), string topicName = default(string), IList propertyColumns = default(IList), IDictionary systemPropertyColumns = default(IDictionary)) { ServiceBusNamespace = serviceBusNamespace; @@ -115,6 +121,11 @@ public ServiceBusTopicOutputDataSource() public IList PropertyColumns { get; set; } /// + /// Gets or sets the system properties associated with the Service Bus + /// Topic Output. The following system properties are supported: + /// ReplyToSessionId, ContentType, To, Subject, CorrelationId, + /// TimeToLive, PartitionKey, SessionId, ScheduledEnqueueTime, + /// MessageId, ReplyTo, Label, ScheduledEnqueueTimeUtc. /// [JsonProperty(PropertyName = "properties.systemPropertyColumns")] public IDictionary SystemPropertyColumns { get; set; } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSku.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Sku.cs similarity index 83% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSku.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Sku.cs index 7bcbc693702d..fd2268b9c3f8 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSku.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Sku.cs @@ -16,23 +16,23 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The properties that are associated with a SKU. /// - public partial class StreamingJobSku + public partial class Sku { /// - /// Initializes a new instance of the StreamingJobSku class. + /// Initializes a new instance of the Sku class. /// - public StreamingJobSku() + public Sku() { CustomInit(); } /// - /// Initializes a new instance of the StreamingJobSku class. + /// Initializes a new instance of the Sku class. /// /// The name of the SKU. Required on PUT /// (CreateOrReplace) requests. Possible values include: /// 'Standard' - public StreamingJobSku(string name = default(string)) + public Sku(string name = default(string)) { Name = name; CustomInit(); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSkuName.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SkuName.cs similarity index 84% rename from sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSkuName.cs rename to sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SkuName.cs index 4fe15bd562fe..bc956d80c3b9 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJobSkuName.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SkuName.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { /// - /// Defines values for StreamingJobSkuName. + /// Defines values for SkuName. /// - public static class StreamingJobSkuName + public static class SkuName { public const string Standard = "Standard"; } 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/StreamInputProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs index 922d6779ea82..489db30d7d1e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs @@ -42,6 +42,8 @@ public StreamInputProperties() /// changed between requests. You can also use it in the If-Match or /// If-None-Match headers for write operations for optimistic /// concurrency. + /// Describes how input data is + /// compressed /// partitionKey Describes a key in the /// input data which is used for partitioning the input data /// Describes an input data source that 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..98a717c0b6a5 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 @@ -96,7 +96,7 @@ public StreamingJob() /// https://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.110).aspx. /// Defaults to 'en-US' if none specified. /// Controls certain runtime behaviors - /// of the streaming job. Possible values include: '1.0' + /// of the streaming job. Possible values include: '1.0', '1.2' /// Value is an ISO-8601 formatted UTC /// timestamp indicating when the streaming job was created. /// A list of one or more inputs to the streaming @@ -125,19 +125,19 @@ public StreamingJob() /// 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 that are associated + /// with an Azure Storage account with MSI /// Valid values are /// JobStorageAccount and SystemAccount. If set to JobStorageAccount, /// this requires the user to also specify jobStorageAccount property. /// Possible values include: 'SystemAccount', /// 'JobStorageAccount' - /// The storage account where the custom code - /// artifacts are located. /// The cluster which streaming jobs will run /// on. /// Describes the system-assigned managed /// identity assigned to this job that can be used to authenticate with /// inputs and outputs. - public StreamingJob(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), StreamingJobSku sku = default(StreamingJobSku), string jobId = default(string), string provisioningState = default(string), string jobState = default(string), string jobType = default(string), string outputStartMode = default(string), System.DateTime? outputStartTime = default(System.DateTime?), System.DateTime? lastOutputEventTime = default(System.DateTime?), string eventsOutOfOrderPolicy = default(string), string outputErrorPolicy = default(string), int? eventsOutOfOrderMaxDelayInSeconds = default(int?), int? eventsLateArrivalMaxDelayInSeconds = default(int?), string dataLocale = default(string), string compatibilityLevel = default(string), System.DateTime? createdDate = default(System.DateTime?), IList inputs = default(IList), Transformation transformation = default(Transformation), IList outputs = default(IList), IList functions = default(IList), string etag = default(string), JobStorageAccount jobStorageAccount = default(JobStorageAccount), string contentStoragePolicy = default(string), External externals = default(External), ClusterInfo cluster = default(ClusterInfo), Identity identity = default(Identity)) + public StreamingJob(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), Sku sku = default(Sku), string jobId = default(string), string provisioningState = default(string), string jobState = default(string), string jobType = default(string), string outputStartMode = default(string), System.DateTime? outputStartTime = default(System.DateTime?), System.DateTime? lastOutputEventTime = default(System.DateTime?), string eventsOutOfOrderPolicy = default(string), string outputErrorPolicy = default(string), int? eventsOutOfOrderMaxDelayInSeconds = default(int?), int? eventsLateArrivalMaxDelayInSeconds = default(int?), string dataLocale = default(string), string compatibilityLevel = default(string), System.DateTime? createdDate = default(System.DateTime?), IList inputs = default(IList), Transformation transformation = default(Transformation), IList outputs = default(IList), IList functions = default(IList), string etag = default(string), JobStorageAccount jobStorageAccount = default(JobStorageAccount), string contentStoragePolicy = default(string), ClusterInfo cluster = default(ClusterInfo), Identity identity = default(Identity)) : base(id, name, type, tags, location) { Sku = sku; @@ -162,7 +162,6 @@ public StreamingJob() Etag = etag; JobStorageAccount = jobStorageAccount; ContentStoragePolicy = contentStoragePolicy; - Externals = externals; Cluster = cluster; Identity = identity; CustomInit(); @@ -178,7 +177,7 @@ public StreamingJob() /// PUT (CreateOrReplace) requests. /// [JsonProperty(PropertyName = "properties.sku")] - public StreamingJobSku Sku { get; set; } + public Sku Sku { get; set; } /// /// Gets a GUID uniquely identifying the streaming job. This GUID is @@ -282,7 +281,7 @@ public StreamingJob() /// /// Gets or sets controls certain runtime behaviors of the streaming - /// job. Possible values include: '1.0' + /// job. Possible values include: '1.0', '1.2' /// [JsonProperty(PropertyName = "properties.compatibilityLevel")] public string CompatibilityLevel { get; set; } @@ -345,25 +344,20 @@ public StreamingJob() public string Etag { get; private set; } /// + /// Gets or sets the properties that are associated with an Azure + /// Storage account with MSI /// [JsonProperty(PropertyName = "properties.jobStorageAccount")] 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; } - - /// - /// Gets or sets the storage account where the custom code artifacts - /// are located. - /// - [JsonProperty(PropertyName = "properties.externals")] - public External Externals { get; set; } + public string ContentStoragePolicy { get; set; } /// /// Gets or sets the cluster which streaming jobs will run on. diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Transformation.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Transformation.cs index 5970e3864383..7df0d3eb40a4 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Transformation.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Transformation.cs @@ -13,6 +13,8 @@ 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; /// @@ -39,6 +41,8 @@ public Transformation() /// Resource type /// Specifies the number of streaming /// units that the streaming job uses. + /// Specifies the valid streaming + /// units a streaming job can scale to. /// Specifies the query that will be run in the /// streaming job. You can learn more about the Stream Analytics Query /// Language (SAQL) here: @@ -49,10 +53,11 @@ public Transformation() /// 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. - public Transformation(string id = default(string), string name = default(string), string type = default(string), int? streamingUnits = default(int?), string query = default(string), string etag = default(string)) + public Transformation(string id = default(string), string name = default(string), string type = default(string), int? streamingUnits = default(int?), IList validStreamingUnits = default(IList), string query = default(string), string etag = default(string)) : base(id, name, type) { StreamingUnits = streamingUnits; + ValidStreamingUnits = validStreamingUnits; Query = query; Etag = etag; CustomInit(); @@ -70,6 +75,13 @@ public Transformation() [JsonProperty(PropertyName = "properties.streamingUnits")] public int? StreamingUnits { get; set; } + /// + /// Gets or sets specifies the valid streaming units a streaming job + /// can scale to. + /// + [JsonProperty(PropertyName = "properties.validStreamingUnits")] + public IList ValidStreamingUnits { get; set; } + /// /// Gets or sets specifies the query that will be run in the streaming /// job. You can learn more about the Stream Analytics Query Language 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..b91d514c823a 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs @@ -59,18 +59,34 @@ internal Operations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - 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) { @@ -150,14 +165,13 @@ internal Operations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -167,10 +181,6 @@ internal Operations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -227,7 +237,7 @@ internal Operations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -323,14 +333,13 @@ internal Operations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -340,10 +349,6 @@ internal Operations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); 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..a518051c91de 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs @@ -83,7 +83,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -254,14 +263,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +279,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -382,7 +386,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -403,6 +407,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 +456,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 +465,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 +479,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) { @@ -544,14 +557,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -561,10 +573,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -640,7 +648,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -654,6 +662,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 +711,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 +718,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 +732,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) { @@ -779,14 +796,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -796,10 +812,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -844,7 +856,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -861,6 +873,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 +922,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 +929,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 +943,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) { @@ -986,14 +1007,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1003,10 +1023,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1085,7 +1101,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1102,6 +1118,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 +1163,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 +1171,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 +1187,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) { @@ -1226,14 +1251,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1243,10 +1267,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1352,7 +1372,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1369,6 +1389,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 +1438,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 +1446,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 +1460,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) { @@ -1501,14 +1530,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1518,10 +1546,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1578,7 +1602,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1674,14 +1698,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1691,10 +1714,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); 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..2a95d7e1fe78 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", "2020-03-01"), + new Tuple("StreamAnalytics", "Inputs", "2020-03-01"), + new Tuple("StreamAnalytics", "Operations", "2020-03-01"), + new Tuple("StreamAnalytics", "Outputs", "2020-03-01"), + new Tuple("StreamAnalytics", "StreamingJobs", "2020-03-01"), + new Tuple("StreamAnalytics", "Subscriptions", "2020-03-01"), + new Tuple("StreamAnalytics", "Transformations", "2020-03-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..3fb75af01a07 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. /// @@ -70,9 +75,14 @@ public partial class StreamAnalyticsManagementClient : ServiceClient - /// Gets the IFunctionsOperations. + /// Gets the IOperations. /// - public virtual IFunctionsOperations Functions { get; private set; } + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IStreamingJobsOperations. + /// + public virtual IStreamingJobsOperations StreamingJobs { get; private set; } /// /// Gets the IInputsOperations. @@ -84,35 +94,20 @@ public partial class StreamAnalyticsManagementClient : ServiceClient public virtual IOutputsOperations Outputs { get; private set; } - /// - /// Gets the IStreamingJobsOperations. - /// - public virtual IStreamingJobsOperations StreamingJobs { get; private set; } - - /// - /// Gets the ISubscriptionsOperations. - /// - public virtual ISubscriptionsOperations Subscriptions { get; private set; } - /// /// Gets the ITransformationsOperations. /// public virtual ITransformationsOperations Transformations { get; private set; } /// - /// Gets the IOperations. - /// - public virtual IOperations Operations { get; private set; } - - /// - /// Gets the IClustersOperations. + /// Gets the IFunctionsOperations. /// - public virtual IClustersOperations Clusters { get; private set; } + public virtual IFunctionsOperations Functions { get; private set; } /// - /// Gets the IPrivateEndpointsOperations. + /// Gets the ISubscriptionsOperations. /// - public virtual IPrivateEndpointsOperations PrivateEndpoints { get; private set; } + public virtual ISubscriptionsOperations Subscriptions { get; private set; } /// /// Initializes a new instance of the StreamAnalyticsManagementClient class. @@ -355,16 +350,15 @@ public StreamAnalyticsManagementClient(System.Uri baseUri, ServiceClientCredenti /// private void Initialize() { - Functions = new FunctionsOperations(this); + Operations = new Operations(this); + StreamingJobs = new StreamingJobsOperations(this); Inputs = new InputsOperations(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); + Functions = new FunctionsOperations(this); + Subscriptions = new SubscriptionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-03-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -394,22 +388,22 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("bindingType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("bindingType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("bindingType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("bindingType")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); 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..1d5fb1b0b492 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs @@ -115,7 +115,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -271,14 +280,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -288,10 +296,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -393,7 +397,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -410,6 +414,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 +459,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 +467,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 +483,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) { @@ -534,14 +547,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -551,10 +563,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -631,7 +639,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -648,6 +656,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 +697,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 +705,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 +719,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) { @@ -766,14 +783,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -783,10 +799,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -847,7 +859,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -864,6 +876,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 +898,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 +906,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 +918,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) { @@ -961,14 +982,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -978,10 +998,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1075,6 +1091,31 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ScaleWithHttpMessagesAsync(string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginScaleWithHttpMessagesAsync(resourceGroupName, jobName, scaleJobParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates a streaming job or replaces an already existing streaming job. /// @@ -1104,7 +1145,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1125,6 +1166,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 +1211,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 +1221,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 +1233,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) { @@ -1269,14 +1319,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1286,10 +1335,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1380,7 +1425,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -1513,14 +1567,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1530,10 +1583,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1579,7 +1628,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1593,6 +1642,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 +1687,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 +1695,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 +1707,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) { @@ -1719,14 +1777,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1736,10 +1793,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1782,7 +1835,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1796,6 +1849,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 +1894,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 +1901,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 +1913,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) { @@ -1915,14 +1977,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1932,10 +1993,215 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _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; + } + + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// 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 BeginScaleWithHttpMessagesAsync(string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("scaleJobParameters", scaleJobParameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("jobName", jobName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginScale", 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/streamingjobs/{jobName}/scale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(scaleJobParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scaleJobParameters, 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 != 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); @@ -1974,7 +2240,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2070,14 +2336,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2087,10 +2352,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2147,7 +2408,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2243,14 +2504,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2260,10 +2520,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperationsExtensions.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperationsExtensions.cs index 1c6abc7da2df..f67d11f9b9e3 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperationsExtensions.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperationsExtensions.cs @@ -422,6 +422,49 @@ public static void Stop(this IStreamingJobsOperations operations, string resourc (await operations.StopWithHttpMessagesAsync(resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + public static void Scale(this IStreamingJobsOperations operations, string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters)) + { + operations.ScaleAsync(resourceGroupName, jobName, scaleJobParameters).GetAwaiter().GetResult(); + } + + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// The cancellation token. + /// + public static async Task ScaleAsync(this IStreamingJobsOperations operations, string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ScaleWithHttpMessagesAsync(resourceGroupName, jobName, scaleJobParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Creates a streaming job or replaces an already existing streaming job. /// @@ -611,6 +654,49 @@ public static void BeginStop(this IStreamingJobsOperations operations, string re (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + public static void BeginScale(this IStreamingJobsOperations operations, string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters)) + { + operations.BeginScaleAsync(resourceGroupName, jobName, scaleJobParameters).GetAwaiter().GetResult(); + } + + /// + /// Scales a streaming job when the job is running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the streaming job. + /// + /// + /// Parameters applicable to a scale streaming job operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginScaleAsync(this IStreamingJobsOperations operations, string resourceGroupName, string jobName, ScaleStreamingJobParameters scaleJobParameters = default(ScaleStreamingJobParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginScaleWithHttpMessagesAsync(resourceGroupName, jobName, scaleJobParameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Lists all of the streaming jobs in the specified resource group. /// 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..c14d76c4a7a3 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs @@ -65,7 +65,7 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -180,14 +189,13 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -197,10 +205,6 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); 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..16f42d8c4ed7 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs @@ -83,7 +83,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -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) { @@ -254,14 +263,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +279,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -383,7 +387,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -404,6 +408,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 +457,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 +466,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 +480,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) { @@ -545,14 +558,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -562,10 +574,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -641,7 +649,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -658,6 +666,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 +715,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 +722,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 +736,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) { @@ -783,14 +800,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -800,10 +816,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex);